From b86589c15a1ceb414050a59f98b009077bdca7cf Mon Sep 17 00:00:00 2001 From: Kwoth Date: Thu, 9 Mar 2017 04:28:05 +0100 Subject: [PATCH] Fixed nullref in repeaters --- .../Modules/Utility/Commands/MessageRepeater.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/NadekoBot/Modules/Utility/Commands/MessageRepeater.cs b/src/NadekoBot/Modules/Utility/Commands/MessageRepeater.cs index c615ef1e..21b3c67b 100644 --- a/src/NadekoBot/Modules/Utility/Commands/MessageRepeater.cs +++ b/src/NadekoBot/Modules/Utility/Commands/MessageRepeater.cs @@ -114,11 +114,10 @@ namespace NadekoBot.Modules.Utility source.Cancel(); } - public override string ToString() - { - return - $"{Channel.Mention} | {(int) Repeater.Interval.TotalHours}:{Repeater.Interval:mm} | {Repeater.Message.TrimTo(33)}"; - } + public override string ToString() => + $"{Channel?.Mention ?? $"⚠<#{Repeater.ChannelId}>" } " + + $"| {(int) Repeater.Interval.TotalHours}:{Repeater.Interval:mm} " + + $"| {Repeater.Message.TrimTo(33)}"; } static RepeatCommands()