add null checks to get theme media

This commit is contained in:
Luke Pulverenti 2016-07-08 14:11:13 -04:00
parent e988588745
commit 671a512699

View File

@ -839,6 +839,7 @@ namespace MediaBrowser.Api.Library
var dtoOptions = GetDtoOptions(request);
var dtos = GetThemeSongIds(item).Select(_libraryManager.GetItemById)
.Where(i => i != null)
.OrderBy(i => i.SortName)
.Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item));
@ -882,6 +883,7 @@ namespace MediaBrowser.Api.Library
var dtoOptions = GetDtoOptions(request);
var dtos = GetThemeVideoIds(item).Select(_libraryManager.GetItemById)
.Where(i => i != null)
.OrderBy(i => i.SortName)
.Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item));