Skip to content

Commit

Permalink
overlay/emotes, system/raffles: Fix error if sender is null
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Apr 3, 2018
1 parent daefea4 commit 3ae615b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/overlays/emotes.js
Expand Up @@ -74,6 +74,8 @@ Emotes.prototype.explode = async function (self, socket, data) {
}

Emotes.prototype.containsEmotes = async function (self, sender, text) {
if (_.isNil(sender)) return true

let OEmotesMax = await global.configuration.getValue('OEmotesMax')
let OEmotesSize = await global.configuration.getValue('OEmotesSize')

Expand Down
2 changes: 2 additions & 0 deletions libs/systems/raffles.js
Expand Up @@ -269,6 +269,8 @@ class Raffles {
}

async participate (self, sender, text) {
if (_.isNil(sender)) return true

const [raffle, user] = await Promise.all([global.db.engine.findOne('raffles', { winner: null }), global.users.get(sender.username)])

const isStartingWithRaffleKeyword = text.startsWith(raffle.keyword)
Expand Down

0 comments on commit 3ae615b

Please sign in to comment.