[gxml] Fixed bug on NamespaceAttrNodeList initialization



commit 6d6d6d358bf86f917dfaf3d014cb178c838bedba
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed Apr 29 11:09:03 2015 -0500

    Fixed bug on NamespaceAttrNodeList initialization

 gxml/libxml-NamespaceAttrNodeList.vala |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gxml/libxml-NamespaceAttrNodeList.vala b/gxml/libxml-NamespaceAttrNodeList.vala
index f3ad2cb..b4634ce 100644
--- a/gxml/libxml-NamespaceAttrNodeList.vala
+++ b/gxml/libxml-NamespaceAttrNodeList.vala
@@ -19,12 +19,16 @@
  * Authors:
  *      Daniel Espinosa <esodan gmail com>
  */
-
+// FIXME: Port this class as an implementation of Gee interfaces
 internal class GXml.NamespaceAttrNodeList : GXml.LinkedList {
        internal NamespaceAttrNodeList (BackedNode root, xDocument owner) {
                base (root);
-               for (Xml.Ns *cur = root.node->ns_def; cur != null; cur = cur->next) {
+    if (root.node->ns_def == null) return;
+               Xml.Ns *cur = root.node->ns_def;
+               while (cur != null) {
                        this.append_child (new NamespaceAttr (cur, owner));
+                       if (cur->next == null) break;
+                       cur = cur->next;
                }
        }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]