Fixed bug when API key is missing
This commit is contained in:
parent
265bf10426
commit
552e921d53
2 changed files with 6 additions and 4 deletions
|
|
@ -29,7 +29,8 @@ export class OMDbAPI extends APIModel {
|
|||
console.log(`MDB | api "${this.apiName}" queried by Title`);
|
||||
|
||||
if (!this.plugin.settings.OMDbKey) {
|
||||
throw Error(`MDB | API key for ${this.apiName} missing.`);
|
||||
console.error(Error(`MDB | API key for ${this.apiName} missing.`));
|
||||
return [];
|
||||
}
|
||||
|
||||
const searchUrl = `https://www.omdbapi.com/?s=${encodeURIComponent(title)}&apikey=${this.plugin.settings.OMDbKey}`;
|
||||
|
|
@ -222,4 +223,4 @@ export class OMDbAPI extends APIModel {
|
|||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue