DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18406>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18406

nightly build script throws npe under some (common) conditions





------- Additional Comments From [EMAIL PROTECTED]  2003-03-27 13:15 -------
Make the patch a little more robust, null may have been
put in the map by maybeconfigure.

Index: Project.java
===================================================================
RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.132
diff -u -r1.132 Project.java
--- Project.java        17 Feb 2003 14:12:10 -0000      1.132
+++ Project.java        27 Mar 2003 13:09:54 -0000
@@ -2195,6 +2195,14 @@
                 // Make sure that
                 ((UnknownElement) o).maybeConfigure();
                 o = ((UnknownElement) o).getTask();
+                // if this is not a task it may be
+                // something else which placed itself in the map.
+                if (o == null) {
+                    o = super.get(key);
+                    // if o is still unknownelement then change back to null
+                    if ((o != null) && (o instanceof UnknownElement))
+                        o = null;
+                }
             }
             return o;
         }

Reply via email to