diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp index 5b80ef5a8f..c9fe32b7a6 100644 --- a/libgnucash/engine/Account.cpp +++ b/libgnucash/engine/Account.cpp @@ -6259,6 +6259,8 @@ gboolean xaccAccountRegister (void) using AccountSet = std::unordered_set; static void maybe_add_descendants (Account* acc, gpointer arg) { + g_return_if_fail (acc); + if (static_cast (arg)->insert (acc).second) g_list_foreach (GET_PRIVATE(acc)->children, (GFunc) maybe_add_descendants, arg); };