Skip to content

Commit

Permalink
pl.class: Add error check for bad input to alternate class instantiat…
Browse files Browse the repository at this point in the history
…ion syntax
  • Loading branch information
alerque committed Sep 28, 2020
1 parent 7c91826 commit b608991
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lua/pl/class.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ local function _class(base,c_arg,c)
-- can define class by passing it a plain table of methods
local plain = type(base) == 'table' and not getmetatable(base)
if plain then
if type(c) == "table" then error("base is not a class",3) end
c = base
base = c._base
else
Expand Down

0 comments on commit b608991

Please sign in to comment.