You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Accessing _bth.t in line 102 causes an exception when _bth is undefined.
Error: Error: Cannot read property 't' of undefined
Jan 28 15:29:36 shellyplusi4-xxxxxxxxxxx 908 386984.546 1 0|in function "unpack" called from ...ice_data[BTHOME_SVC_ID_STR]);
Jan 28 15:29:36 shellyplusi4-xxxxxxxxxxx 909 386984.550 1 0| ^
Jan 28 15:29:36 shellyplusi4-xxxxxxxxxxx 910 386984.560 1 0|in function "getData" called from ...ShellyBLUParser.getData(res); // skip if parsing failed
Jan 28 15:29:36 shellyplusi4-xxxxxxxxxxx 911 386984.563 1 0| ^
Jan 28 15:29:36 shellyplusi4-xxxxxxxxxxx 912 386984.566 1 0|in function called from system
Jan 28 15:29:36 shellyplusi4-xxxxxxxxxxx 913 386984.567 1 0|
Jan 28 15:29:36 shellyplusi4-xxxxxxxxxxx 914 386984.572 1 1|shelly_user_script.:397 error: Error in EjsCall
Reason is that line 97 does not handle check for "undefined" properly.
Possible Solution
Use if (typeof _bth === "undefined") { instead of if (_bth === "undefined") { in line 97.
Without "typeof" this check does not work properly.
Steps to Reproduce (for Bugs)
Use Shelly device with "BLU Gateway Support" activated in thing configuration e.g. Shelly PlusI4.
Wait until periodical bluetooth data is received from Shelly BLU device e.g. Shelly BLU Door/Window (May take some hours).
Script stops working automatically in Shelly due to occuring exception.
Context
Your Environment
Version used: openHAB 4.1.1 with Shelly Binding 4.1.1
Shelly PlusI4 (SNSN-0024X) with FW 1.1.0
Shelly BLU Door/Window (SBDW-002C) with FW 20240115-142209/v1.0.9
The text was updated successfully, but these errors were encountered:
Expected Behavior
Script should handle "undefined" type in receiving buffer without crashing.
Current Behavior
openhab-addons/bundles/org.openhab.binding.shelly/src/main/resources/scripts/oh-blu-scanner.js
Lines 93 to 107 in 07e9b4d
Accessing
_bth.t
in line 102 causes an exception when _bth is undefined.Reason is that line 97 does not handle check for "undefined" properly.
Possible Solution
Use
if (typeof _bth === "undefined") {
instead ofif (_bth === "undefined") {
in line 97.Without "typeof" this check does not work properly.
Steps to Reproduce (for Bugs)
Context
Your Environment
The text was updated successfully, but these errors were encountered: