fix: unsupported property causes an exception (#1469)

fix for: https://github.com/discord-net/Discord.Net/issues/1436

`SlowModeInterval` property causes an exception for Announcement Channel feature if it is enabled on discord. Should be checked whether it is specified or not before set to property.
This commit is contained in:
Mustafa Salih ASLIM
2020-07-10 07:13:46 +03:00
committed by GitHub
parent b8fa464125
commit 468f8264d0

View File

@@ -42,7 +42,8 @@ namespace Discord.Rest
base.Update(model);
CategoryId = model.CategoryId;
Topic = model.Topic.Value;
SlowModeInterval = model.SlowMode.Value;
if (model.SlowMode.IsSpecified)
SlowModeInterval = model.SlowMode.Value;
IsNsfw = model.Nsfw.GetValueOrDefault();
}