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:
admin 2025-12-19 15:53:17 -06:00
parent 2612b184d8
commit 70cfd14971
2 changed files with 2 additions and 17 deletions

View file

@ -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);
}

View file

@ -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);