ParadoxalCorp / felix-production

Felix v5. bot's actual source code
GNU General Public License v3.0
12 stars 6 forks source link

loveship command fails if user has no avatar #40

Closed PwaDesu closed 6 years ago

PwaDesu commented 6 years ago

https://sentry.io/paradoxcorp/felix/issues/604919386/

Error: TypeError: Cannot read property 'replace' of undefined
    at LoveShip.useWebpFormat (/applications/felix-production/commands/image/loveship.js:62:20)
    at LoveShip.run (/applications/felix-production/commands/image/loveship.js:45:79)
  File "/applications/felix-production/commands/image/loveship.js", line 62, in LoveShip.useWebpFormat
    return url.replace(/.jpeg|.jpg|.png|.gif/g, '.webp');
  File "/applications/felix-production/commands/image/loveship.js", line 45, in LoveShip.run
    {snip} atedShip = await client.weebSH.korra.generateLoveShip(this.useWebpFormat(firstUser.avatarURL), this.useWebpFormat(secondUser.avatarURL)).cat {snip}
  File "/applications/felix-production/events/error.js", line 55, in ErrorHandler.handle
    this.sentry.captureException(err, {
  File "/applications/felix-production/events/messageCreate.js", line 144, in command.run.catch.err
    client.bot.emit('error', err, message);
...
(1 additional frame(s) were not displayed)

Error: TypeError: Cannot read property 'replace' of undefined
    at LoveShip.useWebpFormat (/applications/felix-production/commands/image/loveship.js:62:20)
    at LoveShip.run (/applications/felix-production/commands/image/loveship.js:45:79)
PwaDesu commented 6 years ago

fixed with #42