ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 6288] New: - NullPointerException if no environment variables found
Date Wed, 06 Feb 2002 21:13:23 GMT
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=6288>.
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=6288

NullPointerException if no environment variables found

           Summary: NullPointerException if no environment variables found
           Product: Ant
           Version: 1.4.1
          Platform: PC
        OS/Version: Windows 9x
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: jimbuuck@netscape.net


If you have something like:

    <property environment="env"/>

to load all environment variables as ANT properties and ANT does not find any 
environment variables to load, you get a NullPointerException.  This did not 
happen in ANT 1.3.  The one-line fix is to add a protective "if" line at line 
191 in Execute.getProcEnvironment as follows:

            // Since we "look ahead" before adding, there's one last env var.
191 ==>     if (var != null)  // watch out for null if no env vars found
            	procEnvironment.addElement(var);

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message