[libxml++] Schema::get_name(): Don't use null pointer
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml++] Schema::get_name(): Don't use null pointer
- Date: Sat, 11 Oct 2014 09:46:32 +0000 (UTC)
commit 65fe95a374652e9156bff99a02a3fe8b035e0b3f
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Sat Oct 11 11:43:50 2014 +0200
Schema::get_name(): Don't use null pointer
* libxml++/schema.cc: Don't use null pointers in get_name(),
get_target_namespace() and get_version().
libxml++/schema.cc | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libxml++/schema.cc b/libxml++/schema.cc
index d33906a..a1e6351 100644
--- a/libxml++/schema.cc
+++ b/libxml++/schema.cc
@@ -69,17 +69,17 @@ void Schema::set_document(Document* document, bool embed)
Glib::ustring Schema::get_name() const
{
- return impl_ ? (char*)impl_->name : "";
+ return (impl_ && impl_->name) ? (char*)impl_->name : "";
}
Glib::ustring Schema::get_target_namespace() const
{
- return impl_ ? (char*)impl_->targetNamespace : "";
+ return (impl_ && impl_->targetNamespace) ? (char*)impl_->targetNamespace : "";
}
Glib::ustring Schema::get_version() const
{
- return impl_ ? (char*)impl_->version : "";
+ return (impl_ && impl_->version) ? (char*)impl_->version : "";
}
void Schema::release_underlying()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]