1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2025-06-19 23:48:38 -04:00

cmd/ofx: check for nil Currency fields in transactions

This commit is contained in:
mhabb
2021-10-17 12:49:08 -07:00
committed by GitHub
parent cb48d30deb
commit 67fa945cc8
2 changed files with 2 additions and 2 deletions

View File

@ -77,7 +77,7 @@ func bankTransactions() {
func printTransaction(defCurrency ofxgo.CurrSymbol, tran *ofxgo.Transaction) { func printTransaction(defCurrency ofxgo.CurrSymbol, tran *ofxgo.Transaction) {
currency := defCurrency currency := defCurrency
if ok, _ := tran.Currency.Valid(); ok { if tran.Currency != nil {
currency = tran.Currency.CurSym currency = tran.Currency.CurSym
} }

View File

@ -60,7 +60,7 @@ func ccTransactions() {
fmt.Println("Transactions:") fmt.Println("Transactions:")
for _, tran := range stmt.BankTranList.Transactions { for _, tran := range stmt.BankTranList.Transactions {
currency := stmt.CurDef currency := stmt.CurDef
if ok, _ := tran.Currency.Valid(); ok { if tran.Currency != nil {
currency = tran.Currency.CurSym currency = tran.Currency.CurSym
} }