You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/11/02 23:28:37 UTC

DO NOT REPLY [Bug 14195] New: - NPE from dispatch() when no errCode

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

NPE from dispatch() when no errCode

           Summary: NPE from dispatch() when no errCode
           Product: Tomcat 4
           Version: 4.1.14
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper 2
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: hans@gefionsoftware.com


The dispatch(Mark where, String errCode, Object[] args, Exception e) method in
the o.a.jasper.compiler.ErrorDispatcher throws an NPE when it's called from the
jspError(Exception e) method in the same class, since the errCode parameter is
null in this case.

A simple fix is to test for a null errCode and set a default message in this case:

	// Localize
	String errMsg = "Unknown error message";
	if (errCode != null) {
	    errMsg = getString(errCode, args);
	}

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>