From: ishmal Date: Mon, 24 Jul 2006 22:41:47 +0000 (+0000) Subject: Fix a null pointer bug I made myself. Sorry. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e34b436837164a85983d798ae08066800b81e889;p=inkscape.git Fix a null pointer bug I made myself. Sorry. --- diff --git a/src/file.cpp b/src/file.cpp index a9c9184f6..6154fb97d 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -87,7 +87,10 @@ void dump_ustr(Glib::ustring const &ustr); SPDesktop* sp_file_new(const Glib::ustring &templ) { - SPDocument *doc = sp_document_new(templ.c_str(), TRUE, true); + char *templName = NULL; + if (templ.size()>0) + templName = (char *)templ.c_str(); + SPDocument *doc = sp_document_new(templName, TRUE, true); g_return_val_if_fail(doc != NULL, NULL); SPDesktop *dt; @@ -130,7 +133,7 @@ sp_file_new_default() sources.pop_front(); } - return sp_file_new(NULL); + return sp_file_new(""); }