From fea75e5279d342364877286e9cad09bf1747a00f Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 17 Nov 2021 11:45:51 +0800 Subject: [PATCH] try to fix NRE #834 --- TVRename/Sources/TMDB/LocalCache.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/TVRename/Sources/TMDB/LocalCache.cs b/TVRename/Sources/TMDB/LocalCache.cs index a2baa7bf..8536633c 100644 --- a/TVRename/Sources/TMDB/LocalCache.cs +++ b/TVRename/Sources/TMDB/LocalCache.cs @@ -437,11 +437,17 @@ internal CachedMovieInfo DownloadMovieNow([NotNull] ISeriesSpecifier id, bool sh } foreach (Cast? s in downloadedMovie.Credits.Cast) { - m.AddActor(new Actor(s.Id, OriginalImageUrl(s.ProfilePath), s.Name, s.Character, s.CastId, s.Order)); + if (s is not null) + { + m.AddActor(new Actor(s.Id, OriginalImageUrl(s.ProfilePath), s.Name, s.Character, s.CastId, s.Order)); + } } foreach (TMDbLib.Objects.General.Crew? s in downloadedMovie.Credits.Crew) { - m.AddCrew(new Crew(s.Id, OriginalImageUrl(s.ProfilePath), s.Name, s.Job, s.Department, s.CreditId)); + if (s is not null) + { + m.AddCrew(new Crew(s.Id, OriginalImageUrl(s.ProfilePath), s.Name, s.Job, s.Department, s.CreditId)); + } } AddMovieImages(downloadedMovie,m);