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=15795>.
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=15795

Request with mailformed URL causes NullPointerException





------- Additional Comments From [EMAIL PROTECTED]  2003-07-09 14:06 -------
I have the same thing with the exact same stacktrace.

I think the problem is in FileDirContext.java. The javadoc for 
FileDirContext.file(String name) says it should return null if !(file.exists() 
&& file.canRead()). However, before it does that test it calls File(String 
base, String name) without checking for a null argument on name. File then does 
this:

    public File(File parent, String child) {
//!!        -->              ^^unchecked null
        if (child == null) {
            throw new NullPointerException();
        }
        
        ...

My quick suggestion for a fix is this, at FileDirContext.java:879:

        if(name == null) return null;

This should stop Catalina from throwing NullPointers for borken URLs and bring 
the behaviour inline with the javadoc comment. Whether there's another method 
that is returning null when it shouldn't, I haven't checked.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to