You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by rg...@apache.org on 2005/10/04 15:17:36 UTC
svn commit: r293599 -
/forrest/trunk/main/java/org/apache/forrest/locationmap/lm/LocationMap.java
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);