summaryrefslogtreecommitdiff
path: root/io/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'io/init.lua')
-rw-r--r--io/init.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/io/init.lua b/io/init.lua
index c151804..b722a81 100644
--- a/io/init.lua
+++ b/io/init.lua
@@ -18,6 +18,9 @@ function nerv.ChunkFile:write_chunk(chunk)
end
function nerv.ChunkFile:read_chunk(id, global_conf)
+ if self.metadata == nil then
+ nerv.error("wrong file opening mode")
+ end
local metadata = self.metadata[id]
if metadata == nil then
nerv.error("chunk with id %s does not exist", id)