Improve EOF assertion

master
Lars Mueller 2022-05-12 11:52:58 +02:00
parent c8aaf5fccc
commit 0a3dc65121
1 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,7 @@ local models = setmetatable({}, {__index = function(self, filename)
local path = assert(media_paths[filename], filename)
local stream = io.open(path, "r")
local model = assert(modlib.b3d.read(stream))
assert(not stream:read(1))
assert(stream:read(1) == nil, "EOF expected")
stream:close()
self[filename] = model
return model