[V3 General] Fix error in [p]userinfo when game is not set (#1325)

* Fix #1321

Modifies the game-checking lines so that they don't assume `user.game` is not a NoneType object.

* Fix #1321

Modifies the game-checking lines so that they don't assume user.game is not a NoneType object. Also alerts the user to go bother @tekulvw if somehow the invariants of `user` having a `game` attribute and the `game` attribute either being `None` of having a `type` attribute in `[0, 1, 2, 3]` are broken.

* Update general.py
This commit is contained in:
Sebass13 2018-02-20 17:06:06 -06:00 committed by Will
parent 1cca5ee5cb
commit d20724d7b2

View File

@ -215,11 +215,11 @@ class General:
created_on = _("{}\n({} days ago)").format(user_created, since_created)
joined_on = _("{}\n({} days ago)").format(user_joined, since_joined)
game = _("Chilling in {} status").format(user.status)
# Check if the user has a special status
if user.game.type == 0: # "Playing" status
if user.game is None: # Default status
pass
elif user.game.type == 0: # "Playing" status
game = _("Playing {}").format(user.game.name)
elif user.game.type == 1: # "Streaming" status
game = _("Streaming [{}]({})").format(user.game.name, user.game.url)