mirror of
https://github.com/minetest-mods/areas.git
synced 2024-12-22 04:42:23 +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
|
||||
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
|
||||
for id, area in pairs(areas.areas) do
|
||||
if areas:isAreaOwner(id, name) and
|
||||
|
Loading…
Reference in New Issue
Block a user