Commit 1732652e authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Carlos Garnacho

current_folder can be NULL here, do not try to reference it (Bug #540235)

2008-06-26  Carlos Garnacho  <carlos@imendio.com>

        * gtk/gtkfilechooserdefault.c
        (gtk_file_chooser_default_get_current_folder): current_folder can be
        NULL here, do not try to reference it (Bug #540235)
        (gtk_file_chooser_default_get_files): Deal better with
        gtk_file_chooser_default_get_current_folder() being able to return
        NULL.

svn path=/trunk/; revision=20687
parent 260e9454
2008-06-26 Carlos Garnacho <carlos@imendio.com>
* gtk/gtkfilechooserdefault.c
(gtk_file_chooser_default_get_current_folder): current_folder can be
NULL here, do not try to reference it (Bug #540235)
(gtk_file_chooser_default_get_files): Deal better with
gtk_file_chooser_default_get_current_folder() being able to return
NULL.
2008-06-26 Michael Natterer <mitch@imendio.com>
* gtk/gtktextutil.c (_gtk_text_util_append_special_char_menuitems):
......
......@@ -7006,7 +7006,10 @@ gtk_file_chooser_default_get_current_folder (GtkFileChooser *chooser)
return file;
}
return g_object_ref (impl->current_folder);
if (impl->current_folder)
return g_object_ref (impl->current_folder);
return NULL;
}
static void
......@@ -7389,7 +7392,12 @@ gtk_file_chooser_default_get_files (GtkFileChooser *chooser)
if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER &&
info.result == NULL)
{
info.result = g_slist_prepend (info.result, _gtk_file_chooser_get_current_folder_file (chooser));
GFile *current_folder;
current_folder = _gtk_file_chooser_get_current_folder_file (chooser);
if (current_folder)
info.result = g_slist_prepend (info.result, current_folder);
}
return g_slist_reverse (info.result);
......
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