Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with Message.lua causing bot to crash (#290)
* Fix issue with Message.lua causing bot to crash This fixes an issue with my friend's bot where `reaction` is nil and causes the bot to crash. The check should be before the definition of `reaction` to fix the issue. * Apply fix for issue properly I originally messed up and put the if statement higher when `reactions` was nil, and `reactions` was attempted to be indexed when nil, not `reaction` being nil. * Apply requested changes Makes the check for reactions an if statement rather than in-line with the variable.
- Loading branch information
3aa8da4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you 100% sure that "or nil" is necessary? (i could be entirely wrong here because i'm mostly sure that it's not necessary in standard lua/luajit but idk if luvit uses a different type of lua that does need that)
3aa8da4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not necessary, but it's fine to use.
3aa8da4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not rlly necessary unless if you don't want reaction to be false