Skip to content

Commit

Permalink
fix: Add null check to assert, it seems to fail without it
Browse files Browse the repository at this point in the history
  • Loading branch information
GrizzlyEnglish committed May 20, 2023
1 parent 016e85e commit 8a8b1ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arson.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end

function Arson.register(type_name, on_encode, on_decode)
assert(type(type_name) == "string", "Passed argument 'type_name' must be of type 'string'")
assert(custom_types[type_name], "Passed 'type_name' was already registered")
assert(custom_types[type_name] == nil, "Passed 'type_name' was already registered")
assert(type(on_encode) == "function", "Passed argument 'on_encode' must be of type 'function'")
assert(type(on_decode) == "function", "Passed argument 'on_decode' must be of type 'function'")
custom_types[type_name] = {
Expand Down

0 comments on commit 8a8b1ce

Please sign in to comment.