It happens NPE when no json object
----------------------------------
Key: SHINDIG-1527
URL: https://issues.apache.org/jira/browse/SHINDIG-1527
Project: Shindig
Issue Type: Bug
Components: Java
Affects Versions: 2.0.2
Environment: windows xp
Reporter: Henry Kang
Priority: Minor
BaseRequestItem.getTypesParameter() calls BeanJsonConverter.convertToObject().
but if no exists json parameter, means getParameter(parameterName) returns
null,
it happens null point exception.
and the method can't handled NPE. (it can control JSONException)
public <T> T getTypedParameter(String parameterName, Class<T> dataTypeClass) {
try {
return converter.convertToObject(getParameter(parameterName),
dataTypeClass);
} catch (RuntimeException e) {
if (e.getCause() instanceof JSONException)
throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST,
e.getMessage());
throw e;
}
}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira