diff --git a/lib/wall.lua b/lib/wall.lua index 072dc45..6669d98 100644 --- a/lib/wall.lua +++ b/lib/wall.lua @@ -85,7 +85,8 @@ function Wall:update_input() local t = socket.select({ self.socket }, nil, 0)[1] if t then - local bits = self.socket:receive():match "0901(..).." + local rec = self.socket:receive() + local bits = rec and rec:match "0901(..).." if bits then local bits = ("0x" .. bits) * 1 -- convert from hex