Author: lektran
Date: Sat Jun 12 01:10:11 2010
New Revision: 953918
URL:
http://svn.apache.org/viewvc?rev=953918&view=revLog:
Merged from trunk r953917:
Check if errorCode is present before attempting to convert to an integer
Modified:
ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
Modified: ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java?rev=953918&r1=953917&r2=953918&view=diff==============================================================================
--- ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java (original)
+++ ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java Sat Jun 12 01:10:11 2010
@@ -244,10 +244,12 @@ public class ContextFilter implements Fi
if (redirectPath == null) {
int error = 404;
- try {
- error = Integer.parseInt(errorCode);
- } catch (NumberFormatException nfe) {
- Debug.logWarning(nfe, "Error code specified would not parse to Integer : " + errorCode, module);
+ if (UtilValidate.isNotEmpty(errorCode)) {
+ try {
+ error = Integer.parseInt(errorCode);
+ } catch (NumberFormatException nfe) {
+ Debug.logWarning(nfe, "Error code specified would not parse to Integer : " + errorCode, module);
+ }
}
filterMessage = filterMessage + " (" + error + ")";
wrapper.sendError(error, contextUri);