mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-21 18:35:15 -04:00
Fix crash on channels without topic
This commit is contained in:
parent
6ccba43807
commit
7da82f9ef4
1 changed files with 2 additions and 2 deletions
|
@ -52,7 +52,7 @@ namespace DiscordChatExporter.Services
|
||||||
// Get basic data
|
// Get basic data
|
||||||
var id = token["id"].Value<string>();
|
var id = token["id"].Value<string>();
|
||||||
var type = (ChannelType) token["type"].Value<int>();
|
var type = (ChannelType) token["type"].Value<int>();
|
||||||
var topic = token["topic"].Value<string>();
|
var topic = token["topic"]?.Value<string>();
|
||||||
|
|
||||||
// Extract name based on type
|
// Extract name based on type
|
||||||
string name;
|
string name;
|
||||||
|
@ -74,7 +74,7 @@ namespace DiscordChatExporter.Services
|
||||||
// Get basic data
|
// Get basic data
|
||||||
var id = token["id"].Value<string>();
|
var id = token["id"].Value<string>();
|
||||||
var timeStamp = token["timestamp"].Value<DateTime>();
|
var timeStamp = token["timestamp"].Value<DateTime>();
|
||||||
var editedTimeStamp = token["edited_timestamp"].Value<DateTime?>();
|
var editedTimeStamp = token["edited_timestamp"]?.Value<DateTime?>();
|
||||||
var content = token["content"].Value<string>();
|
var content = token["content"].Value<string>();
|
||||||
var type = (MessageType) token["type"].Value<int>();
|
var type = (MessageType) token["type"].Value<int>();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue