diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-23 13:41:52 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-23 13:41:52 +0200 |
commit | 039ab7baef6e1b3a32bd3c4e798672f7626d7807 (patch) | |
tree | f8e9c0f89b524b9ccf5aeba454b88715b8a4b60c | |
parent | 12eeaf863790fe57bfbf271457735a8603011404 (diff) |
fix callBackend when response is null/undefined
-rw-r--r-- | src/wxApi.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wxApi.ts b/src/wxApi.ts index f06ab69a7..b74cb9eb1 100644 --- a/src/wxApi.ts +++ b/src/wxApi.ts @@ -50,7 +50,7 @@ export function getReserveCreationInfo(baseUrl: string, export async function callBackend(type: string, detail?: any): Promise<any> { return new Promise<any>((resolve, reject) => { chrome.runtime.sendMessage({ type, detail }, (resp) => { - if (resp.error) { + if (resp && resp.error) { reject(resp); } else { resolve(resp); |