[gxml] * make sure we handle nulls, rather than just saying we should eventually
- From: Richard Hans Schwarting <rschwart src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] * make sure we handle nulls, rather than just saying we should eventually
- Date: Tue, 9 Aug 2011 02:26:49 +0000 (UTC)
commit e98f9c2aa01bb75635dfb74fb2c1e3e7e9624fac
Author: Richard Schwarting <aquarichy gmail com>
Date: Tue Aug 9 04:26:13 2011 +0200
* make sure we handle nulls, rather than just saying we should eventually
gxml/BackedNode.vala | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/gxml/BackedNode.vala b/gxml/BackedNode.vala
index 2313fd6..e8db4dd 100644
--- a/gxml/BackedNode.vala
+++ b/gxml/BackedNode.vala
@@ -34,8 +34,11 @@ namespace GXml.Dom {
public override string? namespace_uri {
get {
// TODO: there can be multiple NSes on a node, using ->next, right now we just return the first. What should we do?!?!
- return this.node->ns_def->href;
- // TODO: handle null ns_def
+ if (this.node->ns_def == null) {
+ return null;
+ } else {
+ return this.node->ns_def->href;
+ }
// TODO: figure out when node->ns is used, as opposed to ns_def
}
internal set {
@@ -46,8 +49,11 @@ namespace GXml.Dom {
*/
public override string? prefix {
get {
- return this.node->ns_def->prefix;
- // TODO: handle null ns
+ if (this.node->ns_def == null) {
+ return null;
+ } else {
+ return this.node->ns_def->prefix;
+ }
}
internal set {
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]