gnucash stable: [qofobject.cpp] check col!=nullptr instead of obj

Christopher Lam clam at code.gnucash.org
Sun Nov 23 19:23:44 EST 2025


Updated	 via  https://github.com/Gnucash/gnucash/commit/04af7b5f (commit)
	from  https://github.com/Gnucash/gnucash/commit/5de6a080 (commit)



commit 04af7b5fa6e63a7fe9cc424db83b904c1d6a4a1b
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Nov 23 10:33:03 2025 +0800

    [qofobject.cpp] check col!=nullptr instead of obj
    
    because obj was already verified non-nullptr a few lines prior. this
    logic error present since original qofobject.c

diff --git a/libgnucash/engine/qofobject.cpp b/libgnucash/engine/qofobject.cpp
index f6f17e5049..b74a3db79c 100644
--- a/libgnucash/engine/qofobject.cpp
+++ b/libgnucash/engine/qofobject.cpp
@@ -201,7 +201,7 @@ qof_object_foreach (QofIdTypeConst type_name, QofBook *book,
         return;
     }
     col = qof_book_get_collection (book, obj->e_type);
-    if (!obj)
+    if (!col)
     {
         return;
     }



Summary of changes:
 libgnucash/engine/qofobject.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the gnucash-changes mailing list