Explorar o código

Update JsEnv.js

hliang %!s(int64=3) %!d(string=hai) anos
pai
achega
ddeaeabc6f
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  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) {