Skip to content

Commit 0a73044

Browse files
Catch JSONException when the json message is invalid.
1 parent 075cb82 commit 0a73044

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

java/src/main/java/com/genexus/webpanels/GXWebPanel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,9 @@ protected class DynAjaxEvent {
514514
HashSet<String> inParmsMetadataHash;
515515
boolean anyError;
516516

517-
private void parseInputJSonMessage(JSONObject objMessage, GXWebPanel targetObj) throws JSONException {
517+
private void parseInputJSonMessage(String jsonMessage, GXWebPanel targetObj) throws JSONException {
518518
try {
519+
JSONObject objMessage = new JSONObject(jsonMessage);
519520
if (objMessage.has("parms"))
520521
inParmsValues = objMessage.getJSONArray("parms");
521522
if (objMessage.has("hsh"))
@@ -1093,8 +1094,7 @@ private void doInvoke(Object [] MethodParms) throws IllegalArgumentException,
10931094

10941095
public String invoke(String JsonMessage, GXWebPanel targetObj)
10951096
throws Exception {
1096-
JSONObject objMessage = new JSONObject(JsonMessage);
1097-
parseInputJSonMessage(objMessage, targetObj);
1097+
parseInputJSonMessage(JsonMessage, targetObj);
10981098
this.targetObj.setFullAjaxMode();
10991099
this.targetObj.createObjects();
11001100
this.targetObj.initialize();

0 commit comments

Comments
 (0)