Commit 840d975a authored by Patrick Storz's avatar Patrick Storz 🦄

Avoid crash on document close if default template is missing

(cherry picked from commit f6f81cef)
parent 344ce3a1
......@@ -325,7 +325,7 @@ sp_ui_close_view(GtkWidget */*widget*/)
INKSCAPE.get_all_desktops(desktops);
if (desktops.size() == 1) {
Glib::ustring templateUri = sp_file_default_template_uri();
SPDocument *doc = SPDocument::createNewDoc( templateUri.c_str() , TRUE, true );
SPDocument *doc = SPDocument::createNewDoc( templateUri.empty() ? nullptr : templateUri.c_str(), TRUE, true );
// Set viewBox if it doesn't exist
if (!doc->getRoot()->viewBox_set) {
doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDisplayUnit()), doc->getHeight().value(doc->getDisplayUnit())));
......
  • JFYI:

    /tmp/src/inkscape-git/0.92.x/src/ui/interface.cpp:328:75: error: use of undeclared identifier 'nullptr'
            SPDocument *doc = SPDocument::createNewDoc( templateUri.empty() ? nullptr : templateUri.c_str(), TRUE, true );
                                                                              ^
    1 error generated.
    

    (currently, 0.92.x does not require C++11 - in case this is a new requirement, please consider updating the build system accordingly.)

    Edited by su-v
  • mentioned in commit 0c32575a

    Toggle commit list
  • Fixed in 0c32575a

  • mentioned in issue inbox#156 (moved)

    Toggle commit list
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