aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-17 19:25:07 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-17 19:25:07 -0400
commit018913d03fff627fb7d34f594340c47a607e8839 (patch)
tree8bfabfa7b0c1fd2a5d14bbc50738c87c6e694dc0
parentebfc7ca945109c6700b3dbf6d45542ddbba94f3d (diff)
Use isObject
-rw-r--r--ext/bg/js/anki.js6
1 files changed, 1 insertions, 5 deletions
diff --git a/ext/bg/js/anki.js b/ext/bg/js/anki.js
index 928b5159..38823431 100644
--- a/ext/bg/js/anki.js
+++ b/ext/bg/js/anki.js
@@ -112,11 +112,7 @@ class AnkiConnect {
async _invoke(action, params) {
const result = await requestJson(this._server, 'POST', {action, params, version: this._localVersion});
- if (
- result !== null &&
- typeof result === 'object' &&
- !Array.isArray(result)
- ) {
+ if (isObject(result)) {
const error = result.error;
if (typeof error !== 'undefined') {
throw new Error(`AnkiConnect error: ${error}`);