Refactor string checks and fix exception when exporting multiple channels

Fix #164
This commit is contained in:
Alexey Golub
2019-04-11 22:56:29 +03:00
parent 7951703cf2
commit 30cba7959f
20 changed files with 33 additions and 26 deletions

View File

@@ -1,4 +1,6 @@
namespace DiscordChatExporter.Core.Models
using Tyrrrz.Extensions;
namespace DiscordChatExporter.Core.Models
{
// https://discordapp.com/developers/docs/resources/guild#guild-object
@@ -28,7 +30,7 @@
{
public static string GetIconUrl(string id, string iconHash)
{
return iconHash != null
return !iconHash.IsNullOrWhiteSpace()
? $"https://cdn.discordapp.com/icons/{id}/{iconHash}.png"
: "https://cdn.discordapp.com/embed/avatars/0.png";
}