Browse Source

add error cheking

Yuki Takei 4 years ago
parent
commit
7d671da832
1 changed files with 5 additions and 0 deletions
  1. 5 0
      packages/app/src/server/service/slack-integration.ts

+ 5 - 0
packages/app/src/server/service/slack-integration.ts

@@ -124,6 +124,11 @@ export class SlackIntegrationService implements S2sMessageHandlable {
       return generateWebClient(token);
     }
 
+    if (arg == null) {
+      throw new Error('This method cannot be used with null argument under \'officialBot / customBotWithProxy\' type.');
+    }
+
+
     let slackAppIntegration;
     if (typeof arg === 'string') {
       slackAppIntegration = await SlackAppIntegration.findOne({ tokenPtoG: arg });