From f46da7797e73d7b69d2be667ee8f96b301acc501 Mon Sep 17 00:00:00 2001 From: rwst Date: Sat, 8 Jul 2006 17:23:28 +0000 Subject: [PATCH] handle NULL return value, fixes crash when opening filechooser dialog (#1502439) --- src/dialogs/filedialog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dialogs/filedialog.cpp b/src/dialogs/filedialog.cpp index fb6e599a8..6bc56357d 100644 --- a/src/dialogs/filedialog.cpp +++ b/src/dialogs/filedialog.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -1335,14 +1336,16 @@ FileSaveDialogImpl::~FileSaveDialogImpl() - /** * Show this dialog modally. Return true if user hits [OK] */ bool FileSaveDialogImpl::show() { - set_current_folder(get_current_folder()); //hack to force initial dir listing + Glib::ustring s = Glib::filename_to_utf8 (get_current_folder()); + if (s.length() == 0) + s = getcwd (NULL, 0); + set_current_folder(Glib::filename_from_utf8(s)); //hack to force initial dir listing set_modal (TRUE); //Window sp_transientize((GtkWidget *)gobj()); //Make transient gint b = run(); //Dialog -- 2.30.2