summaryrefslogtreecommitdiff
path: root/mesecons_microcontroller
diff options
context:
space:
mode:
authorne-vlezay80 <ne-vlezay80@yandex.ru>2018-11-06 11:48:44 +0300
committersfan5 <sfan5@live.de>2018-11-06 09:48:44 +0100
commitdf4e880d8be157896e45753e27fa929c80664749 (patch)
treecd131f96af3c29a2166966717c1697d7a1eff782 /mesecons_microcontroller
parent45bbd9f7e3c48bccd89d1db5715e7ef3348c5d36 (diff)
downloadmesecons-df4e880d8be157896e45753e27fa929c80664749.tar
mesecons-df4e880d8be157896e45753e27fa929c80664749.tar.gz
mesecons-df4e880d8be157896e45753e27fa929c80664749.tar.bz2
mesecons-df4e880d8be157896e45753e27fa929c80664749.tar.xz
mesecons-df4e880d8be157896e45753e27fa929c80664749.zip
Fix crash in microcontroller (#439)
Add check nil var with bug from crash server. fixes #438
Diffstat (limited to 'mesecons_microcontroller')
-rw-r--r--mesecons_microcontroller/init.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/mesecons_microcontroller/init.lua b/mesecons_microcontroller/init.lua
index 9b1bf3b..f9ba979 100644
--- a/mesecons_microcontroller/init.lua
+++ b/mesecons_microcontroller/init.lua
@@ -571,6 +571,7 @@ yc.command_parsecondition = function(cond, L, eeprom)
if cond:sub(i+1, i+1) == nil then break end
if s == "&" then
if a==nil then return nil end
+ if b==nil then return nil end
local buf = ((a==1) and (b==1))
if buf == true then buf = "1" end
if buf == false then buf = "0" end
@@ -580,6 +581,7 @@ yc.command_parsecondition = function(cond, L, eeprom)
end
if s == "|" then
if a==nil then return nil end
+ if b==nil then return nil end
local buf = ((a == 1) or (b == 1))
if buf == true then buf = "1" end
if buf == false then buf = "0" end
@@ -589,6 +591,7 @@ yc.command_parsecondition = function(cond, L, eeprom)
end
if s == "~" then
if a==nil then return nil end
+ if b==nil then return nil end
local buf = (((a == 1) or (b == 1)) and not((a==1) and (b==1)))
if buf == true then buf = "1" end
if buf == false then buf = "0" end