Bug 798533 - Crash when importing quicken @ currency

Ensure that guess-by-symbol returns GNC_COMMODITY_NS_NONCURRENCY
if there's no previously loaded matching security with a namespace.
This commit is contained in:
John Ralls 2022-06-02 14:52:05 -07:00
parent 559d581cf7
commit b218926e0b

View File

@ -745,12 +745,14 @@
(or (string-ci=? qif-type "stock")
(string-ci=? qif-type "etf")
(string-ci=? qif-type "mutual fund")
(string-ci=? qif-type "index")
))))
(string-ci=? qif-type "index"))))))
prefs)
#f))))
;; If a preferences match was found, use its namespace.
(if pref-match (cadr pref-match)))
#f)))
;; If a preferences match was found, use its namespace,
;; otherwise the default non-currency namespace.
(if pref-match
(cadr pref-match)
(GNC-COMMODITY-NS-NONCURRENCY)))
;; There's no symbol. Use the built-in default.
(GNC-COMMODITY-NS-NONCURRENCY)))
@ -815,6 +817,7 @@
(set! qif-symbol security-name))
;; Create the new security and add it to the hash table.
(hash-set! security-hash
security-name
(gnc-commodity-new book