From ebe459f94f649c9364d0abb877bbd064c8a5c612 Mon Sep 17 00:00:00 2001 From: Lex Trotman Date: Wed, 10 Mar 2010 00:55:21 +0000 Subject: [PATCH] Fix crash due to NULL in project build preferences ( thanks to Wolfgang Ocker ) git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4749 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 7 +++++++ src/build.c | 2 +- src/project.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ae7a632..fcd976ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-03-10 Lex Trotman + + * src/build.c, src/project.c + Fix crash due to NULL in project build preferences ( thanks to + Wolfgang Ocker ) + + 2010-03-09 Nick Treleaven * src/utils.c, src/utils.h, src/search.c, src/search.h, diff --git a/src/build.c b/src/build.c index 13d95317..f58eaeae 100644 --- a/src/build.c +++ b/src/build.c @@ -1859,7 +1859,7 @@ GtkWidget *build_commands_table(GeanyDocument *doc, GeanyBuildSource dst, TableD sep = gtk_hseparator_new(); gtk_table_attach(table, sep, 0, DC_N_COL, 1, 2, GTK_FILL, GTK_FILL | GTK_EXPAND, entry_x_padding, sep_padding); - if (ft->id != GEANY_FILETYPES_NONE) + if (ft != NULL && ft->id != GEANY_FILETYPES_NONE) txt = g_strdup_printf(_("%s Commands"), ft->title); else txt = g_strdup_printf(_("%s Commands"), _("No Filetype")); diff --git a/src/project.c b/src/project.c index df7f5f67..7a52d758 100644 --- a/src/project.c +++ b/src/project.c @@ -401,7 +401,7 @@ static void create_properties_dialog(PropertyDialogElements *e) GtkWidget *label; GtkWidget *swin; GeanyDocument *doc = document_get_current(); - GeanyFiletype *ft; + GeanyFiletype *ft = NULL; e->dialog = create_project_dialog(); gtk_window_set_transient_for(GTK_WINDOW(e->dialog), GTK_WINDOW(main_widgets.window));