1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-08-13 16:53:49 -04:00

Prevent null concatenation when /deleteblocks is provided an incorrect format

This commit is contained in:
kwolekr 2015-01-27 22:36:53 -05:00
parent ad690c46b1
commit a8ec7876a6

View File

@ -420,6 +420,10 @@ core.register_chatcommand("deleteblocks", {
p2 = p1 p2 = p1
else else
local pos1, pos2 = unpack(param:split(") (")) local pos1, pos2 = unpack(param:split(") ("))
if pos1 == nil or pos2 == nil then
return false, "Incorrect area format. Expected: (x1,y1,z1) (x2,y2,z2)"
end
p1 = core.string_to_pos(pos1 .. ")") p1 = core.string_to_pos(pos1 .. ")")
p2 = core.string_to_pos("(" .. pos2) p2 = core.string_to_pos("(" .. pos2)