Minor doc/exception edits

This commit is contained in:
RogueException
2017-03-18 23:22:39 -03:00
parent 3fb21e06c2
commit 0c8d643519
2 changed files with 3 additions and 8 deletions

View File

@@ -50,9 +50,7 @@ namespace Discord.Commands
public bool TryAddFactory<T>(Func<T> factory) where T : class
{
var type = typeof(T);
if (_typeBlacklist.Contains(type))
throw new InvalidOperationException($"{type.FullName} is used internally and cannot be added as a dependency");
if (map.ContainsKey(type))
if (_typeBlacklist.Contains(type) || map.ContainsKey(type))
return false;
map.Add(type, factory);
return true;