Author: lektran
Date: Sat Jun 12 01:06:53 2010
New Revision: 953917
URL:
http://svn.apache.org/viewvc?rev=953917&view=revLog:
Check if errorCode is present before attempting to convert to an integer
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java?rev=953917&r1=953916&r2=953917&view=diff==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java Sat Jun 12 01:06:53 2010
@@ -245,10 +245,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);