mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-06-07 09:54:50 -04:00
parent
d84222ea09
commit
610bf4baa3
1 changed files with 6 additions and 1 deletions
|
@ -50,7 +50,12 @@ namespace DiscordChatExporter.Core.Services
|
||||||
|
|
||||||
// If the name is blank, it's direct messages
|
// If the name is blank, it's direct messages
|
||||||
if (string.IsNullOrWhiteSpace(name))
|
if (string.IsNullOrWhiteSpace(name))
|
||||||
name = json["recipients"].Select(ParseUser).Select(u => u.Name).JoinToString(", ");
|
name = json["recipients"]?.Select(ParseUser).Select(u => u.Name).JoinToString(", ");
|
||||||
|
|
||||||
|
// If the name is still blank for some reason, fallback to ID
|
||||||
|
// (blind fix to https://github.com/Tyrrrz/DiscordChatExporter/issues/227)
|
||||||
|
if (string.IsNullOrWhiteSpace(name))
|
||||||
|
name = id;
|
||||||
|
|
||||||
return new Channel(id, parentId, guildId, name, topic, type);
|
return new Channel(id, parentId, guildId, name, topic, type);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue