Repository: Cog-Creators/Red-DiscordBot

Issue:
[V3 General] Error in command 'userinfo'. 
Please be sure to read through other issues as well to make sure what you are suggesting/reporting has not already
been suggested/reported

### Type:

- [ ] Suggestion
- [x] Bug

### Brief description of the problem
When the command [p]userinfo is done, there is an error if the user has no playing stauts. 
If you have a playing status set, the error does not happen and command works as it should. 

### Expected behavior
using the command [p]userinfo should work if the user has or does not have a playing status set. 

### Actual behavior
error log created:
```
[19/02/2018 14:27] ERROR events on_command_error 162: Exception in command 'userinfo'
Traceback (most recent call last):
  File "/home/unseenmagik/MB3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 62, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "/home/unseenmagik/MB3/lib/python3.5/site-packages/redbot/cogs/general/general.py", line 222, in userinfo
    if user.game.type == 0:  # "Playing" status
AttributeError: 'NoneType' object has no attribute 'type'
[19/02/2018 14:27] ERROR events on_command_error 165: Exception in command 'userinfo'
Traceback (most recent call last):
  File "/home/unseenmagik/MB3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 62, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "/home/unseenmagik/MB3/lib/python3.5/site-packages/redbot/cogs/general/general.py", line 222, in userinfo
    if user.game.type == 0:  # "Playing" status
AttributeError: 'NoneType' object has no attribute 'type'
```

### Steps to reproduce

1. do not set a playing status
2.  run the command [p]userinfo or [p]unserinfo <@user>
3.  Error in command 'userinfo'. Check your console or logs for details.
4. 

[V3 General] Error in command 'userinfo'. 
Please be sure to read through other issues as well to make sure what you are suggesting/reporting has not already
been suggested/reported

### Type:

- [ ] Suggestion
- [x] Bug

### Brief description of the problem
When the command [p]userinfo is done, there is an error if the user has no playing stauts. 
If you have a playing status set, the error does not happen and command works as it should. 

### Expected behavior
using the command [p]userinfo should work if the user has or does not have a playing status set. 

### Actual behavior
error log created:
```
[19/02/2018 14:27] ERROR events on_command_error 162: Exception in command 'userinfo'
Traceback (most recent call last):
  File "/home/unseenmagik/MB3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 62, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "/home/unseenmagik/MB3/lib/python3.5/site-packages/redbot/cogs/general/general.py", line 222, in userinfo
    if user.game.type == 0:  # "Playing" status
AttributeError: 'NoneType' object has no attribute 'type'
[19/02/2018 14:27] ERROR events on_command_error 165: Exception in command 'userinfo'
Traceback (most recent call last):
  File "/home/unseenmagik/MB3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 62, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "/home/unseenmagik/MB3/lib/python3.5/site-packages/redbot/cogs/general/general.py", line 222, in userinfo
    if user.game.type == 0:  # "Playing" status
AttributeError: 'NoneType' object has no attribute 'type'
```

### Steps to reproduce

1. do not set a playing status
2.  run the command [p]userinfo or [p]unserinfo <@user>
3.  Error in command 'userinfo'. Check your console or logs for details.
4. 



Discussion:

Resolving patch:
diff --git a/redbot/cogs/general/general.py b/redbot/cogs/general/general.py
--- a/redbot/cogs/general/general.py
+++ b/redbot/cogs/general/general.py
@@ -215,11 +215,11 @@ async def userinfo(self, ctx, *, user: discord.Member=None):
 
         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)


Test patch: