summaryrefslogtreecommitdiff
path: root/digilines_lightsensor/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'digilines_lightsensor/init.lua')
-rw-r--r--digilines_lightsensor/init.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/digilines_lightsensor/init.lua b/digilines_lightsensor/init.lua
index 2bbbc27..7dda1ce 100644
--- a/digilines_lightsensor/init.lua
+++ b/digilines_lightsensor/init.lua
@@ -50,8 +50,8 @@ minetest.register_node("digilines_lightsensor:lightsensor", {
meta:set_string("formspec", "field[channel;Channel;${channel}]")
end,
on_receive_fields = function(pos, formname, fields, sender)
- local meta = minetest.get_meta(pos)
- fields.channel = fields.channel or ""
- meta:set_string("channel", fields.channel)
+ if (fields.channel) then
+ minetest.get_meta(pos):set_string("channel", fields.channel)
+ end
end,
})