Skip to content

Commit

Permalink
Add missing nil check in hydroturbine code
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Jun 5, 2022
1 parent 27c3c51 commit 58305f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mesecons_hydroturbine/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ minetest.register_node("mesecons_hydroturbine:hydro_turbine_on", {
local function is_flowing_water(pos)
local name = minetest.get_node(pos).name
local is_water = minetest.get_item_group(name, "water") > 0
local is_flowing = minetest.registered_items[name].liquidtype == "flowing"
return (is_water and is_flowing)
local def = minetest.registered_items[name]
return is_water and (def and def.liquidtype == "flowing")
end

minetest.register_abm({
Expand Down

0 comments on commit 58305f5

Please sign in to comment.