mirror of
https://github.com/centau/vide.git
synced 2026-10-22 20:54:09 +00:00
Error when getting an unset context without a default (#101)
Co-authored-by: centau <83140718+centau@users.noreply.github.com>
This commit is contained in:
parent
b24666fc57
commit
c2bd2c2d4c
3 changed files with 13 additions and 1 deletions
|
|
@ -40,7 +40,7 @@ local function context<T>(...: T): Context<T>
|
|||
return (if value ~= nil_symbol then value else nil) :: T
|
||||
end
|
||||
|
||||
if has_default ~= nil then
|
||||
if has_default then
|
||||
return default_value
|
||||
else
|
||||
error("attempt to get context when no context is set and no default context is set", 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue