From 40e310ba6872a0ddc29f5ff3ba9cc805c60ed4a9 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Fri, 5 Nov 2021 10:26:24 +0100 Subject: src/indicator-ng.c: Make sure old menu item name is not NULL before comparison Fixes https://github.com/AyatanaIndicators/libayatana-indicator/issues/60 --- src/indicator-ng.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/indicator-ng.c b/src/indicator-ng.c index f057600..6739584 100644 --- a/src/indicator-ng.c +++ b/src/indicator-ng.c @@ -1,5 +1,6 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Lars Uebernickel + * Robert Tari */ #include "indicator-ng.h" @@ -244,7 +246,7 @@ static gboolean indicator_ng_menu_insert_idos(IndicatorNg *self, GMenuModel *pSe GtkWidget *pMenuItemOld = GTK_WIDGET(g_list_nth_data(lMenuItems, nMenuItem)); const gchar *sName = gtk_widget_get_name(pMenuItemOld); - if (!g_str_equal(sName, sType)) + if (sName != NULL && !g_str_equal(sName, sType)) { GActionGroup *pActionGroup = (GActionGroup*)g_object_get_qdata(G_OBJECT(self->entry.menu), m_pActionMuxer); GMenuItem *pMenuModelItem = g_menu_item_new_from_model(pSection, nModelItem); -- cgit v1.2.3