mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2025-01-12 11:00:28 +01:00
Fix crash on loading invalid schematic (fixes #160)
This commit is contained in:
parent
a1b6a34e61
commit
0edcd1a59d
@ -1150,7 +1150,7 @@ minetest.register_chatcommand("/allocate", {
|
|||||||
file:close()
|
file:close()
|
||||||
|
|
||||||
local version = worldedit.read_header(value)
|
local version = worldedit.read_header(value)
|
||||||
if version == 0 then
|
if version == nil or version == 0 then
|
||||||
worldedit.player_notify(name, "File is invalid!")
|
worldedit.player_notify(name, "File is invalid!")
|
||||||
return
|
return
|
||||||
elseif version > worldedit.LATEST_SERIALIZATION_VERSION then
|
elseif version > worldedit.LATEST_SERIALIZATION_VERSION then
|
||||||
@ -1211,7 +1211,7 @@ minetest.register_chatcommand("/load", {
|
|||||||
file:close()
|
file:close()
|
||||||
|
|
||||||
local version = worldedit.read_header(value)
|
local version = worldedit.read_header(value)
|
||||||
if version == 0 then
|
if version == nil or version == 0 then
|
||||||
worldedit.player_notify(name, "File is invalid!")
|
worldedit.player_notify(name, "File is invalid!")
|
||||||
return
|
return
|
||||||
elseif version > worldedit.LATEST_SERIALIZATION_VERSION then
|
elseif version > worldedit.LATEST_SERIALIZATION_VERSION then
|
||||||
|
Loading…
Reference in New Issue
Block a user