From 9dc9db77232e264edcfec1e6ba6437130ac4c0eb Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Fri, 7 Feb 2014 13:27:42 +0100 Subject: Prevent attempt to initialize/compare std::string with/to null pointer. (bzr r13004) --- src/uri-references.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/uri-references.cpp') diff --git a/src/uri-references.cpp b/src/uri-references.cpp index abe16ec9d..de293716b 100644 --- a/src/uri-references.cpp +++ b/src/uri-references.cpp @@ -58,7 +58,7 @@ void URIReference::attach(const URI &uri) throw(BadURIException) // The path contains references to seperate document files to load. if(document && uri.getPath()) { - std::string base = std::string(document->getBase()); + std::string base = std::string(document->getBase() ? document->getBase() : ""); std::string path = uri.getFullPath(base); if(!path.empty()) document = document->createChildDoc(path); @@ -184,3 +184,14 @@ sp_uri_reference_resolve (SPDocument *document, const gchar *uri) return ref; } + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3