From 1e63f3782abe2c098e988611790753e332a19070 Mon Sep 17 00:00:00 2001 From: snoop Date: Wed, 27 Sep 2017 17:50:16 +0900 Subject: [PATCH] check function exist --- src/ts/@overflow/commons/invoke/ServiceInvoker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ts/@overflow/commons/invoke/ServiceInvoker.ts b/src/ts/@overflow/commons/invoke/ServiceInvoker.ts index d915448..600ee3d 100644 --- a/src/ts/@overflow/commons/invoke/ServiceInvoker.ts +++ b/src/ts/@overflow/commons/invoke/ServiceInvoker.ts @@ -8,14 +8,14 @@ export class ServiceInvoker { public invoke(className: string, methodName: string, params?: any): void { let classObj: Object = this.configMap.get(className); - if (classObj === null) { + if (classObj === null || classObj === undefined) { console.log('Error: Cannot find the class. [' + className + ']'); return; } - if (!classObj.hasOwnProperty(methodName)) { + if (classObj[methodName] === undefined) { console.log('Error: Cannot find the method. [' + methodName + ']'); return; } - classObj[methodName](); + classObj[methodName](params); } }