From 73dec63d1d63cccd1423c21c39626c4a4e5cc90d Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 10 Aug 2023 13:53:21 -0700 Subject: [PATCH] Eliminate a frequent exception in guid_from_string By not trying to construct a GUID from an empty string. --- libgnucash/engine/guid.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libgnucash/engine/guid.cpp b/libgnucash/engine/guid.cpp index aaf58c53ad..55aade3cfd 100644 --- a/libgnucash/engine/guid.cpp +++ b/libgnucash/engine/guid.cpp @@ -186,7 +186,7 @@ guid_to_string_buff (const GncGUID * guid, gchar *str) gboolean string_to_guid (const char * str, GncGUID * guid) { - if (!guid || !str) return false; + if (!guid || !str || !*str) return false; try { @@ -194,6 +194,7 @@ string_to_guid (const char * str, GncGUID * guid) } catch (...) { + PINFO("Failed to construct a GUID from %s", str); return false; } return true;