-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Line 23 in b810368
| in transactions.where((element) => element['Action'] == 'Sale')) { |
This leads to
Unhandled exception:
RangeError (start): Invalid value: Only valid value is 0: 1
#0 RangeError.checkValidRange (dart:core/errors.dart:387:7)
#1 _StringBase.substring (dart:core-patch/string_patch.dart:440:27)
#2 toPrice (package:gsu_cli/do_stuff.dart:72:58)
#3 computeCapitalGains (package:gsu_cli/do_stuff.dart:35:34)
#4 main (file:///Users/maxmichel/Downloads/gsu-main/gsu_cli/bin/gsu_cli.dart:25:28)
I think you can either add that to the for loop condition or end the handling of a transaction directly after the for loop beginning:
if transaction.element['Shares'] == '0' continue;
Metadata
Metadata
Assignees
Labels
No labels