From be8d2a019686850916f9a624522f69e91c891fc9 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 10 Nov 2017 12:23:58 -0500 Subject: MqProfiles: Only save if restored profile insertion succeeds --- (limited to 'src') diff --git a/src/config/profiles.c b/src/config/profiles.c index 021df5e..8a75401 100644 --- a/src/config/profiles.c +++ b/src/config/profiles.c @@ -139,9 +139,11 @@ changed(GFileMonitor G_GNUC_UNUSED *monitor, GFile G_GNUC_UNUSED *file, #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" /* False positive */ if (!g_key_file_has_group(profiles->key_file, profiles->current)) { - insert(profiles, profiles->current, - cur_name, cur_color); - mq_profiles_save(profiles); + if (insert(profiles, profiles->current, + cur_name, cur_color)) + { + mq_profiles_save(profiles); + } } g_free(cur_name); g_free(cur_color); -- cgit v0.9.1