mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[job-report] Prevent Crash if there is no AR account
I think this crash is triggered because the 'account' variable defaults to the first available AR account. If there's no AR account it becomes null, and querying null's default book leads to segfault. I guess I can fix segfault too by fixing gnc_account_get_book.
This commit is contained in:
parent
0594beb081
commit
582265d0c6
@ -541,7 +541,7 @@
|
|||||||
(end-date (gnc:time64-end-day-time
|
(end-date (gnc:time64-end-day-time
|
||||||
(gnc:date-option-absolute-time
|
(gnc:date-option-absolute-time
|
||||||
(opt-val gnc:pagename-general (N_ "To")))))
|
(opt-val gnc:pagename-general (N_ "To")))))
|
||||||
(book (gnc-account-get-book account))
|
(book (gnc-get-current-book))
|
||||||
(date-format (gnc:options-fancy-date book))
|
(date-format (gnc:options-fancy-date book))
|
||||||
(type (opt-val "__reg" "owner-type"))
|
(type (opt-val "__reg" "owner-type"))
|
||||||
(type-str "")
|
(type-str "")
|
||||||
|
@ -1015,6 +1015,7 @@ xaccInitAccount (Account * acc, QofBook *book)
|
|||||||
QofBook *
|
QofBook *
|
||||||
gnc_account_get_book(const Account *account)
|
gnc_account_get_book(const Account *account)
|
||||||
{
|
{
|
||||||
|
if (!account) return NULL;
|
||||||
return qof_instance_get_book(QOF_INSTANCE(account));
|
return qof_instance_get_book(QOF_INSTANCE(account));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user