de3a4c30 by Ean Schuessler

Verify that contentType exists #4051

1 parent 69feb1c7
......@@ -129,8 +129,9 @@ public class DirectControlServlet extends HttpServlet {
}
} else {
// Check if the request is a backbone style "emulateJSON" request
if (request.getContentType().indexOf("x-www-form-urlencoded") != -1 &&
request.getParameter("model") != null) {
if (request.getContentType() != null &&
request.getContentType().indexOf("x-www-form-urlencoded") != -1 &&
request.getParameter("model") != null) {
Debug.logInfo("MODEL: " + request.getParameter("model"), module);
JSON json = new JSON(new StringReader(request.getParameter("model")));
Map<String,Object> items = json.JSONObject();
......