From 3be430feebe884a68b93efef2d9ce0632bba6cd4 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Wed, 11 Dec 2024 21:29:06 +0100 Subject: [PATCH] Bug 799470 - Crash when clicking on Schedule Transaction Editor It's not the root cause of the crash, but the extra sanity check will prevent it anyway --- gnucash/gnome/gnc-plugin-page-sx-list.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnucash/gnome/gnc-plugin-page-sx-list.cpp b/gnucash/gnome/gnc-plugin-page-sx-list.cpp index a220236129..ebf83de984 100644 --- a/gnucash/gnome/gnc-plugin-page-sx-list.cpp +++ b/gnucash/gnome/gnc-plugin-page-sx-list.cpp @@ -586,6 +586,11 @@ gnc_plugin_page_sx_list_create_widget (GncPluginPage *plugin_page) /* Set number of months from preference, default 12 */ auto num_months = gnc_prefs_get_int (GNC_PREFS_GROUP_SXED, GNC_PREF_NUM_OF_MONTHS); + if (num_months == 0) + { + PWARN ("Got invalid value '0' for number of months to display. This suggests a gsettings configuration issue. Continuing with a default value of 12 instead."); + num_months = 12; + } gnc_dense_cal_set_num_months (priv->gdcal, num_months); gtk_container_add (GTK_CONTAINER(swin), GTK_WIDGET(priv->gdcal));