forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r293599 - /forrest/trunk/main/java/org/apache/forrest/locationmap/lm/LocationMap.java
Date Tue, 04 Oct 2005 13:17:36 GMT
Author: rgardler
Date: Tue Oct  4 06:17:24 2005
New Revision: 293599

URL: http://svn.apache.org/viewcvs?rev=293599&view=rev
Log:
Check there are some mountNodes and locatorNodes before working with them, prevents NullPointerExceptions
clogging up Error Log. Reported by David.

Modified:
    forrest/trunk/main/java/org/apache/forrest/locationmap/lm/LocationMap.java

Modified: forrest/trunk/main/java/org/apache/forrest/locationmap/lm/LocationMap.java
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/java/org/apache/forrest/locationmap/lm/LocationMap.java?rev=293599&r1=293598&r2=293599&view=diff
==============================================================================
--- forrest/trunk/main/java/org/apache/forrest/locationmap/lm/LocationMap.java (original)
+++ forrest/trunk/main/java/org/apache/forrest/locationmap/lm/LocationMap.java Tue Oct  4
06:17:24 2005
@@ -261,19 +261,23 @@
         context.pushMap(ANCHOR_NAME,anchorMap);
 
         //mounted locations first
-        for (int i = 0; i < m_mountNodes.length; i++) {
-        	location = m_mountNodes[i].locate(om,context);
-        	if (location !=null) {
-        		ContainerUtil.dispose(context);
-        		return location;
-        	}
-        }
-
-        for (int i = 0; i < m_locatorNodes.length; i++) {
-            location = m_locatorNodes[i].locate(om,context);
-            if (location != null) {
-                break;
+        if (m_mountNodes != null) {
+          for (int i = 0; i < m_mountNodes.length; i++) {
+            location = m_mountNodes[i].locate(om,context);
+            if (location !=null) {
+              ContainerUtil.dispose(context);
+              return location;
             }
+          }
+        }
+        
+        if (m_locatorNodes != null) {
+          for (int i = 0; i < m_locatorNodes.length; i++) {
+              location = m_locatorNodes[i].locate(om,context);
+              if (location != null) {
+                  break;
+              }
+          }
         }
         
         ContainerUtil.dispose(context);



Mime
View raw message