From b7e734ac105d53d63ce72e16af3e664a4263f0cd Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Tue, 12 Nov 2024 20:29:30 +0100 Subject: [PATCH] Fix error when no connection --- shelly/syncscript.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shelly/syncscript.js b/shelly/syncscript.js index 329478b..6d21f84 100644 --- a/shelly/syncscript.js +++ b/shelly/syncscript.js @@ -137,7 +137,12 @@ function sendToZoblak() { "body": JSON.stringify(payload) }, function(result) { - print("server says: ", result.code); + if (result) { + print("server says: ", result.code); + } + else { + print("There is no server response present. Check connection!") + } } );