瀏覽代碼

Update JsEnv.js

hliang 3 年之前
父節點
當前提交
ddeaeabc6f
共有 1 個文件被更改,包括 6 次插入2 次删除
  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) {