de3a4c30 by Ean Schuessler

Verify that contentType exists #4051

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