Kaydet (Commit) 40690fc5 authored tarafından Enrico Tröger's avatar Enrico Tröger

fixed a crash when clicking on the run button and no file is opened

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@345 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 1ebf62ee
......@@ -347,6 +347,7 @@ gboolean document_remove(guint page_num)
utils_set_window_title(-1);
utils_save_buttons_toggle(FALSE);
utils_close_buttons_toggle();
utils_build_show_hide(-1);
}
}
else geany_debug("Error: idx: %d page_num: %d", idx, page_num);
......
......@@ -1249,9 +1249,19 @@ void utils_build_show_hide(gint idx)
#ifndef GEANY_WIN32
gboolean is_header = FALSE;
gchar *ext = NULL;
filetype *ft = doc_list[idx].file_type;
filetype *ft;
if (idx >= 0 && doc_list[idx].file_name)
if (idx == -1)
{
gtk_widget_set_sensitive(lookup_widget(app->window, "menu_build1"), FALSE);
gtk_widget_set_sensitive(app->compile_button, FALSE);
gtk_widget_set_sensitive(app->run_button, FALSE);
return;
}
ft = doc_list[idx].file_type;
if (doc_list[idx].file_name)
{
ext = strrchr(doc_list[idx].file_name, '.');
}
......
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