Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
unspecified
-
None
Description
In TestPortlet.doDispatch(), the following code assumes that the test portlet will be a number (line 127):
TestConfig config = null;
if(testId != null)
This throws a java.lang.NumberFormatException when the testId has no value which is currently the case when you click the "Return to Index" button in the test portlet.
One way to fix this is to check for the case when testId is an empty String or when testId is not a number inside the getTestId(PortletRequest req) method. In that case, the method should return null.
For example, the first "if" block in that method could be changed to this (line 181):
if((testId == null || testId.trim().length() == 0) &&
next == null && previous == null && tests.size() > 0)