mirror of
https://github.com/Radarr/Radarr
synced 2026-01-24 00:13:43 +01:00
fix: SonarCloud null safety and struct comparison issues
- OsPath.cs: Remove ReferenceEquals checks on struct (always false) - SkyHookProxy.cs: Add null-conditional operators for Credits.Cast/Crew
This commit is contained in:
parent
2612b184d8
commit
70cfd14971
2 changed files with 2 additions and 17 deletions
|
|
@ -376,11 +376,6 @@ public bool Equals(OsPath other)
|
|||
|
||||
public bool Equals(OsPath other, bool ignoreTrailingSlash)
|
||||
{
|
||||
if (ReferenceEquals(other, null))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_path == other._path)
|
||||
{
|
||||
return true;
|
||||
|
|
@ -399,21 +394,11 @@ public bool Equals(OsPath other, bool ignoreTrailingSlash)
|
|||
|
||||
public static bool operator ==(OsPath left, OsPath right)
|
||||
{
|
||||
if (ReferenceEquals(left, null))
|
||||
{
|
||||
return ReferenceEquals(right, null);
|
||||
}
|
||||
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator !=(OsPath left, OsPath right)
|
||||
{
|
||||
if (ReferenceEquals(left, null))
|
||||
{
|
||||
return !ReferenceEquals(right, null);
|
||||
}
|
||||
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ public Tuple<MovieMetadata, List<Credit>> GetMovieInfo(int tmdbId)
|
|||
}
|
||||
|
||||
var credits = new List<Credit>();
|
||||
credits.AddRange(httpResponse.Resource.Credits.Cast.Select(MapCast));
|
||||
credits.AddRange(httpResponse.Resource.Credits.Crew.Select(MapCrew));
|
||||
credits.AddRange(httpResponse.Resource.Credits?.Cast?.Select(MapCast) ?? Enumerable.Empty<Credit>());
|
||||
credits.AddRange(httpResponse.Resource.Credits?.Crew?.Select(MapCrew) ?? Enumerable.Empty<Credit>());
|
||||
|
||||
var movie = MapMovie(httpResponse.Resource);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue