NRE fixes in simpleMessageConverter, !urban and errorHandler
This commit is contained in:
parent
6a163366ea
commit
5a4e710ef9
3 changed files with 8 additions and 8 deletions
|
@ -39,7 +39,7 @@ namespace Geekbot.net.Lib.ErrorHandling
|
|||
{
|
||||
try
|
||||
{
|
||||
var errorString = errorMessage == "def" ? await _translation.GetString(context.Guild.Id, "errorHandler", "SomethingWentWrong") : errorMessage;
|
||||
var errorString = errorMessage == "def" ? await _translation.GetString(context.Guild?.Id ?? 0, "errorHandler", "SomethingWentWrong") : errorMessage;
|
||||
var errorObj = SimpleConextConverter.ConvertContext(context);
|
||||
if (e.Message.Contains("50007")) return;
|
||||
if (e.Message.Contains("50013")) return;
|
||||
|
|
|
@ -25,13 +25,13 @@ namespace Geekbot.net.Lib.Logger
|
|||
},
|
||||
Guild = new MessageDto.IdAndName
|
||||
{
|
||||
Id = context.Guild.Id.ToString(),
|
||||
Name = context.Guild.Name
|
||||
Id = context.Guild?.Id.ToString(),
|
||||
Name = context.Guild?.Name
|
||||
},
|
||||
Channel = new MessageDto.IdAndName
|
||||
{
|
||||
Id = context.Channel.Id.ToString(),
|
||||
Name = context.Channel.Name
|
||||
Id = context.Channel?.Id.ToString() ?? context.User.Id.ToString(),
|
||||
Name = context.Channel?.Name ?? "DM-Channel"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -61,8 +61,8 @@ namespace Geekbot.net.Lib.Logger
|
|||
},
|
||||
Channel = new MessageDto.IdAndName
|
||||
{
|
||||
Id = channel?.Id.ToString(),
|
||||
Name = channel?.Name
|
||||
Id = channel?.Id.ToString() ?? message.Author.Id.ToString(),
|
||||
Name = channel?.Name ?? "DM-Channel"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue