Skip to content

Commit

Permalink
Libraries no longer error when returning nil/false
Browse files Browse the repository at this point in the history
  • Loading branch information
Cruor committed Oct 23, 2023
1 parent 36333d8 commit 47aef29
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libraries.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ function libraries.registerLibrary(filename, registerAt, verbose)
registerAt = registerAt or libraries.registeredLibraries

local pathNoExt = utils.stripExtension(filename)
local filenameNoExt = utils.filename(pathNoExt, "/")
local library = utils.rerequire(pathNoExt)

if type(library) ~= "table" then
return
end

local name = library.name or pathNoExt

registerAt[name] = library
Expand Down

0 comments on commit 47aef29

Please sign in to comment.