Skip to content

Commit

Permalink
Fixes FreeApophis#1 - The Exists Method of ModeList was called with C…
Browse files Browse the repository at this point in the history
…hannelMode as the Generic Parameter and the Test failed therefore after the first Mode. The method is now called with reflection with the actual type instead of the declared type.
  • Loading branch information
FreeApophis committed Dec 27, 2014
1 parent 1b17f8c commit 86beb6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion IrcD.Net/Modes/ModeList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public ModeList(IrcDaemon ircDaemon)

public void Add<T>(T element) where T : TMode
{
if (!Exist<T>())
bool exists = (bool)typeof(ModeList<TMode>).GetMethod("Exist").MakeGenericMethod(new[] { element.GetType() }).Invoke(this, null);
if (exists == false)
{
Add(element.Char, element);
}
Expand Down

0 comments on commit 86beb6a

Please sign in to comment.