diff --git a/src/app-utils/options.scm b/src/app-utils/options.scm index 4b132feee9..375411ac46 100644 --- a/src/app-utils/options.scm +++ b/src/app-utils/options.scm @@ -1464,7 +1464,9 @@ ((options 'for-each-general) section-thunk option-thunk)) (define (gnc:lookup-option options section name) - ((options 'lookup) section name)) + (if options + ((options 'lookup) section name) + #f)) (define (gnc:generate-restore-forms options options-string) ((options 'generate-restore-forms) options-string)) diff --git a/src/report/report-system/report.scm b/src/report/report-system/report.scm index cfd1f4457e..a6a5d8501e 100644 --- a/src/report/report-system/report.scm +++ b/src/report/report-system/report.scm @@ -356,15 +356,23 @@ ;; This is the function that is called when saved reports are evaluated. (define (gnc:restore-report id template-name options) - (let ((r ((record-constructor ) - (gnc:report-template-name-to-id template-name) id options #t #t #f #f))) - (gnc-report-add r)) + (if options + (let ((r ((record-constructor ) + (gnc:report-template-name-to-id template-name) id options #t #t #f #f))) + (gnc-report-add r)) + (begin + (gnc-error-dialog '() (string-append "Report Failed! One of your previously opened reports has failed to open. The template on which it was based: " template-name ", was not found.")) + #f)) ) (define (gnc:restore-report-by-guid id template-id template-name options) - (let ((r ((record-constructor ) - template-id id options #t #t #f #f))) - (gnc-report-add r)) + (if options + (let ((r ((record-constructor ) + template-id id options #t #t #f #f))) + (gnc-report-add r)) + (begin + (gnc-error-dialog '() (string-append "Report Failed! One of your previously opened reports has failed to open. The template on which it was based: " template-name ", was not found.")) + #f)) ) (define (gnc:make-report-options template-name)