Merge pull request #5105 from crobibero/image-null-ref

Add null check for ImageTags
This commit is contained in:
Claus Vium 2021-01-25 19:27:59 +01:00 committed by GitHub
commit e7e385d7a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1157,7 +1157,7 @@ namespace Emby.Server.Implementations.Dto
if (episodeSeries != null)
{
dto.SeriesPrimaryImageTag = GetTagAndFillBlurhash(dto, episodeSeries, ImageType.Primary);
if (!dto.ImageTags.ContainsKey(ImageType.Primary))
if (dto.ImageTags == null || !dto.ImageTags.ContainsKey(ImageType.Primary))
{
AttachPrimaryImageAspectRatio(dto, episodeSeries);
}
@ -1207,7 +1207,7 @@ namespace Emby.Server.Implementations.Dto
if (series != null)
{
dto.SeriesPrimaryImageTag = GetTagAndFillBlurhash(dto, series, ImageType.Primary);
if (!dto.ImageTags.ContainsKey(ImageType.Primary))
if (dto.ImageTags == null || !dto.ImageTags.ContainsKey(ImageType.Primary))
{
AttachPrimaryImageAspectRatio(dto, series);
}