From 10f1ff19051adb575fc479708329fdec38b50d71 Mon Sep 17 00:00:00 2001 From: RogueException Date: Tue, 13 Oct 2015 01:49:46 -0300 Subject: [PATCH] Don't throw a nullreference in EditProfile if the current user doesn't have an associated email --- src/Discord.Net/DiscordClient.API.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord.Net/DiscordClient.API.cs b/src/Discord.Net/DiscordClient.API.cs index 35c08624d..cc39957aa 100644 --- a/src/Discord.Net/DiscordClient.API.cs +++ b/src/Discord.Net/DiscordClient.API.cs @@ -635,7 +635,7 @@ namespace Discord { if (currentPassword == null) throw new ArgumentNullException(nameof(currentPassword)); - return _api.EditProfile(currentPassword: currentPassword, username: username, email: email ?? _currentUser.Email, password: password, + return _api.EditProfile(currentPassword: currentPassword, username: username, email: email ?? _currentUser?.Email, password: password, avatarType: avatarType, avatar: avatar); }