Commit d68835f6 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Fail on empty icon names

parent d94741d6
......@@ -562,10 +562,10 @@ girara_session_init(girara_session_t* session, const char* sessionname)
char* window_icon = NULL;
girara_setting_get(session, "window-icon", &window_icon);
if (window_icon != NULL) {
if (window_icon != NULL && strlen(window_icon) != 0) {
girara_set_window_icon(session, window_icon);
g_free(window_icon);
}
g_free(window_icon);
gtk_widget_grab_focus(GTK_WIDGET(session->gtk.view));
......@@ -888,6 +888,11 @@ girara_set_window_icon(girara_session_t* session, const char* name)
return false;
}
if (strlen(name) == 0) {
girara_warning("Empty icon name.");
return false;
}
GtkWindow* window = GTK_WINDOW(session->gtk.window);
char* path = girara_fix_path(name);
bool success = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment