diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-13 22:44:54 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-13 22:44:54 -0500 |
| commit | 635c8d50a361dc2eabbeea0ae55048d1e9f4ad8f (patch) | |
| tree | ebcf01208a34c24215416bdae32e66eab1438e6a /Emby.Server.Implementations/Channels/ChannelManager.cs | |
| parent | 0e9cd51f9c64d4cfad5cb5c7b0ddae6af8d18ac6 (diff) | |
update character escaping
Diffstat (limited to 'Emby.Server.Implementations/Channels/ChannelManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Channels/ChannelManager.cs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Channels/ChannelManager.cs b/Emby.Server.Implementations/Channels/ChannelManager.cs index 94ff7c342..0df916ded 100644 --- a/Emby.Server.Implementations/Channels/ChannelManager.cs +++ b/Emby.Server.Implementations/Channels/ChannelManager.cs @@ -1108,7 +1108,11 @@ namespace Emby.Server.Implementations.Channels { if (_fileSystem.GetLastWriteTimeUtc(cachePath).Add(cacheLength) > DateTime.UtcNow) { - return _jsonSerializer.DeserializeFromFile<ChannelItemResult>(cachePath); + var cachedResult = _jsonSerializer.DeserializeFromFile<ChannelItemResult>(cachePath); + if (cachedResult != null) + { + return cachedResult; + } } } } @@ -1131,7 +1135,11 @@ namespace Emby.Server.Implementations.Channels { if (_fileSystem.GetLastWriteTimeUtc(cachePath).Add(cacheLength) > DateTime.UtcNow) { - return _jsonSerializer.DeserializeFromFile<ChannelItemResult>(cachePath); + var cachedResult = _jsonSerializer.DeserializeFromFile<ChannelItemResult>(cachePath); + if (cachedResult != null) + { + return cachedResult; + } } } } @@ -1162,6 +1170,11 @@ namespace Emby.Server.Implementations.Channels var result = await channel.GetChannelItems(query, cancellationToken).ConfigureAwait(false); + if (result == null) + { + throw new InvalidOperationException("Channel returned a null result from GetChannelItems"); + } + if (!startIndex.HasValue && !limit.HasValue) { CacheResponse(result, cachePath); |
