[Part 2] Audit all .scm files for cases where null objects were assumed

to be #f.  (It helps to save all buffers before the commit.)




git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15061 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Chris Shoemaker 2006-10-29 03:39:39 +00:00
parent e4ebb3eb1b
commit e528848f5a
9 changed files with 13 additions and 13 deletions

View File

@ -242,7 +242,7 @@
;; used to use alternate account guids when creating splits.
(define (gnc:transaction-scm-onto-transaction trans-scm trans guid-mapping
commit? book)
(if (not trans)
(if (null? trans)
#f
(begin
;; open the transaction for editing

View File

@ -612,7 +612,7 @@
(book (xaccGroupGetBook (gnc-get-current-group)))
(existing-type
(xaccAccountGetType existing-gnc-acct)))
(if (and existing-gnc-acct
(if (and (not (null? existing-gnc-acct))
(memv existing-type (list GNC-STOCK-TYPE
GNC-MUTUAL-TYPE)))
;; gnc account already exists... we *know* what the

View File

@ -386,7 +386,7 @@
(set! heinous-error #t))))))
;; update the progress bar for each line read
(if progress-dialog
(if (not (null? progress-dialog))
(begin
(gnc-progress-dialog-set-value
progress-dialog (/ bytes-read file-size))
@ -405,7 +405,7 @@
;; they were in the file. This is important in a few cases.
(qif-file:set-xtns! self (reverse (qif-file:xtns self)))
(if progress-dialog
(if (not (null? progress-dialog))
(gnc-progress-dialog-destroy progress-dialog))
return-val)))

View File

@ -108,7 +108,7 @@
(hash-fold
(lambda (name acct p)
(let ((cmdty (xaccAccountGetCommodity acct)))
(if (not cmdty)
(if (null? cmdty)
(begin
(xaccAccountBeginEdit acct)
(xaccAccountSetCommodity acct commodity)

View File

@ -56,7 +56,7 @@
gnc-acct-info acct-name acct-type))
(split (xaccMallocSplit (gnc-get-current-book))))
;; make the account if necessary
(if (not acct)
(if (or (not acct) (null? acct))
(begin
(set! acct (xaccMallocAccount (gnc-get-current-book)))
(xaccAccountBeginEdit acct)

View File

@ -156,7 +156,7 @@
gnc-acct-info acct-name acct-type))
(split (xaccMallocSplit (gnc-get-current-book))))
;; make the account if necessary
(if (not acct)
(if (or (not acct) (null? acct))
(begin
(set! acct (xaccMallocAccount (gnc-get-current-book)))
(xaccAccountSetName acct acct-name)

View File

@ -285,7 +285,7 @@
(define (account-get-depth account)
(define (account-get-depth-internal account-internal depth)
(let ((parent (xaccAccountGetParentAccount account-internal)))
(if parent
(if (not (null? parent))
(account-get-depth-internal parent (+ depth 1))
depth)))
(account-get-depth-internal account 1))

View File

@ -277,7 +277,7 @@
(s-commodity (xaccAccountGetCommodity s-account)))
;; Check if this is a dangling split
;; and print a warning
(if (not s-account)
(if (null? s-account)
(display
(string-append
"WARNING: s-account is NULL for split: "
@ -285,7 +285,7 @@
;(gnc:debug (xaccAccountGetName s-account))
(if (and ;; make sure we don't have
s-account ;; any dangling splits
(not (null? s-account)) ;; any dangling splits
(not (account-in-list? s-account accounts)))
(if (not (split-in-list? s seen-split-list))
(begin

View File

@ -128,8 +128,8 @@
;; display an account name depending on the options the user has set
(define (account-namestring account show-account-code show-account-name show-account-full-name)
;;# on multi-line splits we can get an empty (#f) account
(if (not account)
;;# on multi-line splits we can get an empty ('()) account
(if (null? account)
(_ "Split")
(string-append
;; display account code?
@ -418,7 +418,7 @@
(parent (xaccSplitGetParent split))
(account (xaccSplitGetAccount split))
(account-type (xaccAccountGetType account))
(currency (if account
(currency (if (not (null? account))
(xaccAccountGetCommodity account)
(gnc-default-currency)))
(report-currency (if (opt-val gnc:pagename-general optname-common-currency)