Screen out price records with blank values.

Found a live Quicken record with an empty price.
This commit is contained in:
Jeremy White
2023-08-14 09:36:14 -05:00
committed by John Ralls
parent 9cacaa72e8
commit 06b6d60f5b
2 changed files with 8 additions and 1 deletions

View File

@@ -1163,6 +1163,10 @@
(string->number (cadr fracprice)))))
(set! price (format #f "~f" total))))
(qif-price:set-share-price! current-xtn price))))
(qif-price:set-share-price! current-xtn price)
;; A blank entry will not necessarily throw an exception, but is invalid
(if (or (string-null? symbol) (or (string-null? price) (string-null? date)))
(set! current-xtn #f)))))
(set! current-xtn #f))
current-xtn))

View File

@@ -77,5 +77,8 @@
(qif-price:set-date! model "1/1' 4")
(test-equal parsed model))
(let ((parsed (qif-file:parse-price-line "\"ABC\",,\"1/1' 4\"")))
(test-equal parsed #f))
(let ((parsed (qif-file:parse-price-line "\"ABC\",\"1/1' 4\"")))
(test-equal parsed #f)))