Skip to content

Commit

Permalink
fix nil bug in portal_api.lua
Browse files Browse the repository at this point in the history
fixes a nil bug in portal_api.lua where nodedef.is_ground_content isn't available.
  • Loading branch information
tenplus1 authored and Treer committed Jul 8, 2021
1 parent fb6b666 commit b90afa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion portal_api.lua
Expand Up @@ -2211,7 +2211,7 @@ function nether.volume_is_natural_and_unprotected(minp, maxp, player_name)
if id ~= c_air and id ~= c_ignore and id ~= nil then -- checked for common natural or not emerged
local name = minetest.get_name_from_content_id(id)
local nodedef = minetest.registered_nodes[name]
if not nodedef.is_ground_content then
if nodedef and not nodedef.is_ground_content then
-- trees are natural but not "ground content"
local node_groups = nodedef.groups
if node_groups == nil or (node_groups.tree == nil and node_groups.leaves == nil and node_groups.leafdecay == nil) then
Expand Down

0 comments on commit b90afa0

Please sign in to comment.