From: rwst Date: Sat, 8 Jul 2006 17:23:28 +0000 (+0000) Subject: handle NULL return value, fixes crash when opening filechooser dialog (#1502439) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f46da7797e73d7b69d2be667ee8f96b301acc501;p=inkscape.git handle NULL return value, fixes crash when opening filechooser dialog (#1502439) --- 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