diff --git a/README.md b/README.md index 423567c..b21af84 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,10 @@ For every shopping list a channel with the following states will be created: Placeholder for the next version (at the beginning of the line): ### **WORK IN PROGRESS** --> + +### **WORK IN PROGRESS** +* (foxriver76) fixed setting `undefined` state when no name specified + ### 1.8.3 (2023-09-25) * (foxriver76) Improve error messages diff --git a/main.js b/main.js index a7603d7..6d6ab34 100755 --- a/main.js +++ b/main.js @@ -327,8 +327,8 @@ async function tryLogin() { try { await bring.login(); await adapter.setState(`info.connection`, true, true); - await adapter.setState(`info.user`, bring.name, true); - adapter.log.info(`[LOGIN] Successfully logged in as ${bring.name}`); + await adapter.setState(`info.user`, bring.name ?? '', true); + adapter.log.info(`[LOGIN] Successfully logged in as ${bring.name ? bring.name : 'unknown'}`); if (loginTimeout) { clearTimeout(loginTimeout); }