Browse Source

Add check for cachemode in rest channel GetCategory

pull/1004/head
Chris Johnston 8 years ago
parent
commit
36f49e1d25
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs
  2. +1
    -1
      src/Discord.Net.Rest/Entities/Channels/RestVoiceChannel.cs

+ 1
- 1
src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs View File

@@ -177,7 +177,7 @@ namespace Discord.Rest
// INestedChannel
async Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options)
{
if (CategoryId.HasValue)
if (CategoryId.HasValue && mode == CacheMode.AllowDownload)
return (await Guild.GetChannelAsync(CategoryId.Value, mode, options).ConfigureAwait(false)) as ICategoryChannel;
return null;
}


+ 1
- 1
src/Discord.Net.Rest/Entities/Channels/RestVoiceChannel.cs View File

@@ -56,7 +56,7 @@ namespace Discord.Rest
// INestedChannel
async Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options)
{
if (CategoryId.HasValue)
if (CategoryId.HasValue && mode == CacheMode.AllowDownload)
return (await Guild.GetChannelAsync(CategoryId.Value, mode, options).ConfigureAwait(false)) as ICategoryChannel;
return null;
}


Loading…
Cancel
Save