From 5ac6a630720ce6800dea0f253f3895b4ade412fd Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 5 Apr 2012 20:11:37 +0200 Subject: fix crash (bug #973174) Fixed bugs: - https://launchpad.net/bugs/973174 (bzr r11158) --- src/file.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index 88fbc542d..0657f0b10 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -860,10 +860,11 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, Inkscape::Extens g_warning( "Error converting save filename to UTF-8." ); Inkscape::Extension::Output *omod = dynamic_cast(selectionType); - Glib::ustring save_extension = (std::string)omod->get_extension(); - - if ( !hasEnding(fileName, save_extension.c_str()) ) { - fileName += save_extension.c_str(); + if (omod) { + Glib::ustring save_extension = (std::string)omod->get_extension(); + if ( !hasEnding(fileName, save_extension.c_str()) ) { + fileName += save_extension.c_str(); + } } // FIXME: does the argument !is_copy really convey the correct meaning here? -- cgit v1.2.3