Fix: Proper error on missing entity property

pull/16/head
Juraj Nyíri 4 years ago
parent 2c98e806a6
commit c64e6acc27

@ -20000,7 +20000,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
}; };
this.setConfig = (config) => { this.setConfig = (config) => {
this.plexProtocol = 'http'; 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'); throw new Error('You need to define at least one entity');
} }
if (!config.token) { if (!config.token) {

@ -736,7 +736,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
setConfig = (config: any): void => { setConfig = (config: any): void => {
this.plexProtocol = 'http'; 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'); throw new Error('You need to define at least one entity');
} }
if (!config.token) { if (!config.token) {

Loading…
Cancel
Save