From f0ee1dfa0c369466c1d2e109252bcda0f5464009 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Thu, 13 Aug 2020 11:08:52 +0200 Subject: Try to prevent cascading failure if IDO creation fails --- libayatana-indicator/indicator-ng.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libayatana-indicator/indicator-ng.c b/libayatana-indicator/indicator-ng.c index 8ede1a6..c0e85e5 100644 --- a/libayatana-indicator/indicator-ng.c +++ b/libayatana-indicator/indicator-ng.c @@ -265,6 +265,11 @@ static gboolean indicator_ng_menu_insert_idos(IndicatorNg *self, GMenuModel *pSe bChanged = TRUE; } + if (pMenuItemNew == NULL) + { + pMenuItemNew = GTK_MENU_ITEM(gtk_menu_item_new_with_label("Failed to create IDO object")); + } + gtk_widget_set_name(GTK_WIDGET(pMenuItemNew), sType); gtk_widget_show(GTK_WIDGET(pMenuItemNew)); gtk_container_remove(GTK_CONTAINER(self->entry.menu), pMenuItemOld); -- cgit v1.2.3