summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMorten Welinder <terra@gnome.org>2004-03-14 19:47:20 +0000
committerMorten Welinder <mortenw@src.gnome.org>2004-03-14 19:47:20 +0000
commitdf8b419ecfa0e168a6fad8bad8031ef3073d0813 (patch)
treef9cca108b5abcf3de89911bac3d83a90c05d3875 /gtk
parente8a4c8442d759d97fa081352ad4788f32a2a9086 (diff)
downloadgdk-pixbuf-df8b419ecfa0e168a6fad8bad8031ef3073d0813.tar.gz
Don't crash on NULL path; don't crash on NULL error.
2004-03-14 Morten Welinder <terra@gnome.org> * gtk/gtkfilechooserdefault.c (error_dialog): Don't crash on NULL path; don't crash on NULL error.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkfilechooserdefault.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 9f91b1072..727e8f8c7 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -662,17 +662,19 @@ error_dialog (GtkFileChooserDefault *impl,
const GtkFilePath *path,
GError *error)
{
- char *uri;
- char *text;
+ g_return_if_fail (path != NULL);
- uri = gtk_file_system_path_to_uri (impl->file_system, path);
- text = g_strdup_printf (msg,
- uri,
- error->message);
- error_message (impl, text);
- g_free (text);
- g_free (uri);
- g_error_free (error);
+ if (error)
+ {
+ char *uri = gtk_file_system_path_to_uri (impl->file_system, path);
+ text = g_strdup_printf (msg,
+ uri,
+ error->message);
+ error_message (impl, text);
+ g_free (text);
+ g_free (uri);
+ g_error_free (error);
+ }
}
/* Displays an error message about not being able to get information for a file.