From df6b54d2f57d1b50fee2f2b69f2118b266f65f37 Mon Sep 17 00:00:00 2001
From: sfan5 <sfan5@live.de>
Date: Wed, 12 Oct 2016 19:38:41 +0200
Subject: Fix blowing up TNT near worldedit markers

---
 worldedit_commands/mark.lua | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'worldedit_commands')

diff --git a/worldedit_commands/mark.lua b/worldedit_commands/mark.lua
index 4062cae..7f880ea 100644
--- a/worldedit_commands/mark.lua
+++ b/worldedit_commands/mark.lua
@@ -153,7 +153,11 @@ minetest.register_entity(":worldedit:region_cube", {
 		end
 	end,
 	on_punch = function(self, hitter)
-		for _, entity in ipairs(worldedit.marker_region[self.player_name]) do
+		local markers = worldedit.marker_region[self.player_name]
+		if not markers then
+			return
+		end
+		for _, entity in ipairs(markers) do
 			entity:remove()
 		end
 		worldedit.marker_region[self.player_name] = nil
-- 
cgit v1.2.3