From 840d975a39364c80b6238451390c727696f33eec Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 30 Sep 2018 03:57:56 +0200 Subject: [PATCH] Avoid crash on document close if default template is missing (cherry picked from commit f6f81cef2493222e62a97d255792593a47b3e99b) --- src/ui/interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index ab29471ed0..d8a292960d 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -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()))); -- GitLab