diff --git a/src/AModule.cpp b/src/AModule.cpp index 77b82cee..9948edab 100644 --- a/src/AModule.cpp +++ b/src/AModule.cpp @@ -134,11 +134,14 @@ bool AModule::handleUserEvent(GdkEventButton* const& e) { format = rec->second; } - // Check if the event is the one specified for the "menu" option - if (rec->second == config_["menu"].asString()) { - // Popup the menu - gtk_widget_show_all(GTK_WIDGET(menu_)); - gtk_menu_popup_at_pointer(GTK_MENU(menu_), reinterpret_cast(e)); + // Check that a menu has been configured + if (config_["menu"].isString()) { + // Check if the event is the one specified for the "menu" option + if (rec->second == config_["menu"].asString()) { + // Popup the menu + gtk_widget_show_all(GTK_WIDGET(menu_)); + gtk_menu_popup_at_pointer(GTK_MENU(menu_), reinterpret_cast(e)); + } } // Second call user scripts if (!format.empty()) {