From e10b19e53384d31aa698f8407bc4bf7df6d1b928 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Tue, 3 May 2016 05:55:05 +0200 Subject: [PATCH] fixed some "error in command ran" console errors --- NadekoBot/Classes/NadekoStats.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NadekoBot/Classes/NadekoStats.cs b/NadekoBot/Classes/NadekoStats.cs index 483e2214..ba4187de 100644 --- a/NadekoBot/Classes/NadekoStats.cs +++ b/NadekoBot/Classes/NadekoStats.cs @@ -209,10 +209,10 @@ namespace NadekoBot commandsRan++; Classes.DbHandler.Instance.InsertData(new DataModels.Command { - ServerId = (long)e.Server.Id, - ServerName = e.Server.Name, + ServerId = (long)(e.Server?.Id ?? 0), + ServerName = e.Server?.Name ?? "--Direct Message--", ChannelId = (long)e.Channel.Id, - ChannelName = e.Channel.Name, + ChannelName = e.Channel.IsPrivate ? "--Direct Message" : e.Channel.Name, UserId = (long)e.User.Id, UserName = e.User.Name, CommandName = e.Command.Text,