From d8f6981fe698b105873f7a82b77bc5e97b8d51ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sat, 9 Nov 2019 02:21:57 +0100 Subject: [PATCH] Gui: Only promt overwrite message of auto-naming tool when there are actual elements in the layer selector --- gds-render-gui.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gds-render-gui.c b/gds-render-gui.c index df1ce38..cbdd6ee 100644 --- a/gds-render-gui.c +++ b/gds-render-gui.c @@ -758,6 +758,10 @@ static void auto_naming_clicked(GtkWidget *button, gpointer user_data) gui = RENDERER_GUI(user_data); + /* Don't do anything if the selector is empty. */ + if (!layer_selector_contains_elements(gui->layer_selector)) + return; + /* Ask for overwrite */ dialog = GTK_DIALOG(gtk_message_dialog_new(gui->main_window, GTK_DIALOG_USE_HEADER_BAR, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "Overwrite existing layer names?"));