Ver código fonte

Update JsEnv.js

hliang 3 anos atrás
pai
commit
ddeaeabc6f
1 arquivos alterados com 6 adições e 2 exclusões
  1. 6 2
      JsEnv.js

+ 6 - 2
JsEnv.js

@@ -54,9 +54,13 @@ Hlclient.prototype.handlerRequest = function (requestJson) {
 	if (!result['action']) {
         this.sendResult('','need request param {action}');
         return
-    }
-	action=result["action"]
+}
+    action=result["action"]
     var theHandler = this.handlers[action];
+    if (!theHandler ||theHandler==undefined){
+	    this.sendResult(action,'action not found');
+	    return
+    }
     try {
 		if (!result["param"]){
 			theHandler(function (response) {