Author: jflesch
Date: 2006-12-03 18:14:17 +0000 (Sun, 03 Dec 2006)
New Revision: 11217

Modified:
   trunk/apps/Thaw/src/thaw/core/Logger.java
   trunk/apps/Thaw/src/thaw/plugins/index/Index.java
Log:
Fix NPE when parsing an incomplete index

Modified: trunk/apps/Thaw/src/thaw/core/Logger.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/Logger.java   2006-12-03 16:01:35 UTC (rev 
11216)
+++ trunk/apps/Thaw/src/thaw/core/Logger.java   2006-12-03 18:14:17 UTC (rev 
11217)
@@ -20,7 +20,7 @@
         *
         * 2 or more is recommanded.
         */
-       public final static int LOG_LEVEL = 3;
+       public final static int LOG_LEVEL = 2;

        private static Vector logListeners = null;


Modified: trunk/apps/Thaw/src/thaw/plugins/index/Index.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/Index.java   2006-12-03 16:01:35 UTC 
(rev 11216)
+++ trunk/apps/Thaw/src/thaw/plugins/index/Index.java   2006-12-03 18:14:17 UTC 
(rev 11217)
@@ -1097,6 +1097,9 @@
        public void loadHeader(Element rootEl) {
                Element header = 
(Element)rootEl.getElementsByTagName("header").item(0);

+               if (header == null)
+                       return;
+
                this.realName = this.getHeaderElement(header, "title");
                this.author = this.getHeaderElement(header, "owner");

@@ -1135,6 +1138,10 @@
                this.purgeLinkList();

                Element links = 
(Element)rootEl.getElementsByTagName("indexes").item(0);
+
+               if (links == null)
+                       return;
+
                NodeList list = links.getChildNodes();

                for(int i = 0; i < list.getLength() ; i++) {
@@ -1154,6 +1161,10 @@
                this.purgeFileList();

                Element filesEl = 
(Element)rootEl.getElementsByTagName("files").item(0);
+
+               if (filesEl == null)
+                       return;
+
                NodeList list = filesEl.getChildNodes();

                for(int i = 0; i < list.getLength() ; i++) {


Reply via email to