summaryrefslogtreecommitdiffstats
path: root/src/ui/interface.cpp
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2018-09-30 01:57:56 +0000
committerEduard Braun <eduard.braun2@gmx.de>2018-09-30 01:57:56 +0000
commitf6f81cef2493222e62a97d255792593a47b3e99b (patch)
treecd8939ace9d09a0ca57022eb66153ffb90c80669 /src/ui/interface.cpp
parentCanonicalize path read from INKSCAPE_DATADIR environment variable (diff)
downloadinkscape-f6f81cef2493222e62a97d255792593a47b3e99b.tar.gz
inkscape-f6f81cef2493222e62a97d255792593a47b3e99b.zip
Avoid crash on document close if default template is missing
Diffstat (limited to 'src/ui/interface.cpp')
-rw-r--r--src/ui/interface.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp
index 5edaab193..1c42b1d99 100644
--- a/src/ui/interface.cpp
+++ b/src/ui/interface.cpp
@@ -345,7 +345,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())));