From e34b436837164a85983d798ae08066800b81e889 Mon Sep 17 00:00:00 2001 From: ishmal Date: Mon, 24 Jul 2006 22:41:47 +0000 Subject: [PATCH] Fix a null pointer bug I made myself. Sorry. --- src/file.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(""); } -- 2.30.2