fix callBackend when response is null/undefined

This commit is contained in:
Florian Dold 2017-05-23 13:41:52 +02:00
parent 12eeaf8637
commit 039ab7baef
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -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);