fix callBackend when response is null/undefined
This commit is contained in:
parent
12eeaf8637
commit
039ab7baef
@ -50,7 +50,7 @@ export function getReserveCreationInfo(baseUrl: string,
|
|||||||
export async function callBackend(type: string, detail?: any): Promise<any> {
|
export async function callBackend(type: string, detail?: any): Promise<any> {
|
||||||
return new Promise<any>((resolve, reject) => {
|
return new Promise<any>((resolve, reject) => {
|
||||||
chrome.runtime.sendMessage({ type, detail }, (resp) => {
|
chrome.runtime.sendMessage({ type, detail }, (resp) => {
|
||||||
if (resp.error) {
|
if (resp && resp.error) {
|
||||||
reject(resp);
|
reject(resp);
|
||||||
} else {
|
} else {
|
||||||
resolve(resp);
|
resolve(resp);
|
||||||
|
Loading…
Reference in New Issue
Block a user