From 088a386dc7aa643269f665c1cb5df77e78f3c020 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sun, 16 Aug 2020 17:55:00 +0800 Subject: [PATCH] [gnc-plugin-page-register.c] sanity check invoices_from_transaction prevent segfault if trans is NULL. would crash when deleting a split. --- gnucash/gnome/gnc-plugin-page-register.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c index bcf006f736..f8d4034b1e 100644 --- a/gnucash/gnome/gnc-plugin-page-register.c +++ b/gnucash/gnome/gnc-plugin-page-register.c @@ -4590,6 +4590,8 @@ static GncInvoice* invoice_from_split (Split* split) GList* invoices_from_transaction (Transaction* trans) { GList *invoices = NULL; + if (!trans) return NULL; + for (GList *node = xaccTransGetAPARAcctSplitList(trans, TRUE); node; node = node->next) {