1
0
mirror of https://github.com/Uberi/Minetest-WorldEdit.git synced 2024-12-25 02:00:39 +01:00

Fix crash on loading invalid schematic (fixes #160)

This commit is contained in:
sfan5 2019-09-06 17:56:11 +02:00
parent a1b6a34e61
commit 0edcd1a59d

View File

@ -1150,7 +1150,7 @@ minetest.register_chatcommand("/allocate", {
file:close()
local version = worldedit.read_header(value)
if version == 0 then
if version == nil or version == 0 then
worldedit.player_notify(name, "File is invalid!")
return
elseif version > worldedit.LATEST_SERIALIZATION_VERSION then
@ -1211,7 +1211,7 @@ minetest.register_chatcommand("/load", {
file:close()
local version = worldedit.read_header(value)
if version == 0 then
if version == nil or version == 0 then
worldedit.player_notify(name, "File is invalid!")
return
elseif version > worldedit.LATEST_SERIALIZATION_VERSION then