From 497402dbafde74cce7ff3c09e8b98ef714b79bf7 Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Thu, 1 Jan 2004 18:20:33 +0000 Subject: [PATCH] * src/engine/qofinstance.c: return a "valid" GUID even if passed a NULL object, because lots of code assumes you can get a guid all the time. So, just return guid_null() instead of NULL. Fixes a SEGV. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9742 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 6 ++++++ src/engine/qofinstance.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e493145554..941f2636c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-01-01 Derek Atkins + + * src/engine/qofinstance.c: return a "valid" GUID even if passed a NULL + object, because lots of code assumes you can get a guid all the time. + So, just return guid_null() instead of NULL. Fixes a SEGV. + 2003-12-23 Christian Stimming * src/engine/gnc-trace.c: Patch enabling compilation on Mac OS X diff --git a/src/engine/qofinstance.c b/src/engine/qofinstance.c index 26c69e61a4..d192221c70 100644 --- a/src/engine/qofinstance.c +++ b/src/engine/qofinstance.c @@ -69,7 +69,7 @@ qof_instance_release (QofInstance *inst) const GUID * qof_instance_get_guid (QofInstance *inst) { - if (!inst) return NULL; + if (!inst) return guid_null(); /* some callers depend on a real return value */ return &inst->entity.guid; }