Don't crash if Mention.Resolve is passed a private message.

This commit is contained in:
RogueException
2015-12-01 19:58:43 -04:00
parent a38acfa74d
commit 6ced9449b0

View File

@@ -72,7 +72,7 @@ namespace Discord
if (source == null) throw new ArgumentNullException(nameof(source));
if (text == null) throw new ArgumentNullException(nameof(text));
return Resolve(source.Server, text);
return Resolve(source?.Server, text);
}
/// <summary>Resolves all mentions in a provided string to those users, channels or roles' names.</summary>