Browse Source

Fixed possible null reference.

tags/3.0.4
Teknikode 4 years ago
parent
commit
e6468d3d8b
1 changed files with 9 additions and 6 deletions
  1. 9
    6
      IRCServices/IRC.cs

+ 9
- 6
IRCServices/IRC.cs View File

@@ -460,13 +460,16 @@ namespace Combot.IRCServices
case ChannelMode.a:
case ChannelMode.q:
Nick changedNick = channel.GetNick(mode.Parameter);
if (mode.Set)
{
changedNick.AddPrivilege((PrivilegeMode)Enum.Parse(typeof(PrivilegeMode), mode.Mode.ToString()));
}
else
if (changedNick != null)
{
changedNick.RemovePrivilege((PrivilegeMode)Enum.Parse(typeof(PrivilegeMode), mode.Mode.ToString()));
if (mode.Set)
{
changedNick.AddPrivilege((PrivilegeMode) Enum.Parse(typeof (PrivilegeMode), mode.Mode.ToString()));
}
else
{
changedNick.RemovePrivilege((PrivilegeMode) Enum.Parse(typeof (PrivilegeMode), mode.Mode.ToString()));
}
}
break;
case ChannelMode.b:

Loading…
Cancel
Save