Skip to content

Commit

Permalink
Add more boolean states
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Minari <yangm97@gmail.com>
  • Loading branch information
yangm97 committed Dec 17, 2018
1 parent 892fac9 commit 0618854
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/groupbutler/storage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ local chat_type = enum({
})

local function string_toboolean(v)
if v == false or v == "off" or v == "notok" or v == "no" then
if v == false or "false" or v == "off" or v == "notok" or v == "no" then
return false
end
if v == true or v == "on" or v == "ok" or v == "yes" then
if v == true or "true" or v == "on" or v == "ok" or v == "yes" then
return true
end
log.warn("Tried toboolean on non truthy value")
Expand Down

1 comment on commit 0618854

@giuseppeM99
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't be a v == before "true" and "false"

Please sign in to comment.