Commit f6f81cef authored by Patrick Storz's avatar Patrick Storz 🦄

Avoid crash on document close if default template is missing

parent fdce285e
Pipeline #31582015 passed with stages
in 4 minutes and 58 seconds
......@@ -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())));
......
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