From 7da82f9ef42fe7d2e330e2f9e67e266c8a219ad8 Mon Sep 17 00:00:00 2001 From: Oleksii Holub Date: Wed, 10 Jan 2018 18:28:42 +0200 Subject: [PATCH] Fix crash on channels without topic --- DiscordChatExporter/Services/DataService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DiscordChatExporter/Services/DataService.cs b/DiscordChatExporter/Services/DataService.cs index cabc2dcf..11ecc2cf 100644 --- a/DiscordChatExporter/Services/DataService.cs +++ b/DiscordChatExporter/Services/DataService.cs @@ -52,7 +52,7 @@ namespace DiscordChatExporter.Services // Get basic data var id = token["id"].Value(); var type = (ChannelType) token["type"].Value(); - var topic = token["topic"].Value(); + var topic = token["topic"]?.Value(); // Extract name based on type string name; @@ -74,7 +74,7 @@ namespace DiscordChatExporter.Services // Get basic data var id = token["id"].Value(); var timeStamp = token["timestamp"].Value(); - var editedTimeStamp = token["edited_timestamp"].Value(); + var editedTimeStamp = token["edited_timestamp"]?.Value(); var content = token["content"].Value(); var type = (MessageType) token["type"].Value();