From 133f03d45aa5dd087ef7efb08c81391896a7cbd5 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sun, 5 Jul 2015 16:14:33 -0700 Subject: [PATCH] Fix crash on attempting to load features from KVP if there aren't any. --- src/libqof/qof/qofbook.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libqof/qof/qofbook.cpp b/src/libqof/qof/qofbook.cpp index d72cb6d614..e34ee08195 100644 --- a/src/libqof/qof/qofbook.cpp +++ b/src/libqof/qof/qofbook.cpp @@ -1066,8 +1066,12 @@ qof_book_get_features (QofBook *book) GHashTable *features = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free); - frame = frame->get_slot(GNC_FEATURES)->get(); - frame->for_each_slot(&add_feature_to_hash, &features); + auto slot = frame->get_slot(GNC_FEATURES); + if (slot != nullptr) + { + frame = slot->get(); + frame->for_each_slot(&add_feature_to_hash, &features); + } return features; }