user 6 年 前
コミット
046255a6fe
3 ファイル変更7 行追加1 行削除
  1. 3 0
      lib/index.js
  2. 1 1
      lib/index.js.map
  3. 3 0
      src/index.ts

+ 3 - 0
lib/index.js

@@ -262,6 +262,9 @@ class BankClient {
     }
     getContactBook(peerId) {
         return __awaiter(this, void 0, void 0, function* () {
+            if (peerId == null) {
+                throw new Error('Missing peerId');
+            }
             return new contact_book_1.ContactBook(yield this.getAllContacts(peerId));
         });
     }

ファイルの差分が大きいため隠しています
+ 1 - 1
lib/index.js.map


+ 3 - 0
src/index.ts

@@ -253,6 +253,9 @@ export class BankClient {
     }
 
     public async getContactBook(peerId: string): Promise<ContactBook> {
+      if (peerId == null) {
+        throw new Error('Missing peerId');
+      }
       return new ContactBook(await this.getAllContacts(peerId));
     }