mirror of
https://github.com/minetest-mods/areas.git
synced 2024-12-22 12:52:22 +01:00
Fix /find_areas invalid regular expression crash
This commit is contained in:
parent
0d0215200c
commit
db1d87c008
@ -172,6 +172,16 @@ minetest.register_chatcommand("find_areas", {
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Check expression for validity
|
||||||
|
local function testRegExp()
|
||||||
|
("Test [1]: Player (0,0,0) (0,0,0)"):find(param)
|
||||||
|
end
|
||||||
|
if not pcall(testRegExp) then
|
||||||
|
minetest.chat_send_player(name,
|
||||||
|
"Invalid regular expression.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local found = false
|
local found = false
|
||||||
for id, area in pairs(areas.areas) do
|
for id, area in pairs(areas.areas) do
|
||||||
if areas:isAreaOwner(id, name) and
|
if areas:isAreaOwner(id, name) and
|
||||||
|
Loading…
Reference in New Issue
Block a user