From c64e6acc27aed38946bf742de7089a50723b04e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Sat, 8 May 2021 12:59:13 +0200 Subject: [PATCH] Fix: Proper error on missing entity property --- dist/plex-meets-homeassistant.js | 2 +- src/plex-meets-homeassistant.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index b1ec43c..e98ec55 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -20000,7 +20000,7 @@ class PlexMeetsHomeAssistant extends HTMLElement { }; this.setConfig = (config) => { this.plexProtocol = 'http'; - if (config.entity.length === 0) { + if (!config.entity || config.entity.length === 0) { throw new Error('You need to define at least one entity'); } if (!config.token) { diff --git a/src/plex-meets-homeassistant.ts b/src/plex-meets-homeassistant.ts index 10d6871..f81aacb 100644 --- a/src/plex-meets-homeassistant.ts +++ b/src/plex-meets-homeassistant.ts @@ -736,7 +736,7 @@ class PlexMeetsHomeAssistant extends HTMLElement { setConfig = (config: any): void => { this.plexProtocol = 'http'; - if (config.entity.length === 0) { + if (!config.entity || config.entity.length === 0) { throw new Error('You need to define at least one entity'); } if (!config.token) {