Skip to content

Commit

Permalink
changing == null to is null
Browse files Browse the repository at this point in the history
  • Loading branch information
TJ Lambert committed Feb 18, 2022
1 parent 72aa449 commit 6ce47be
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/AssetsLibrary/ALAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public double Duration {
// note: this can return an NSString like: ALErrorInvalidProperty
// which causes an InvalidCastException with a normal cast
var n = ValueForProperty (_PropertyDuration) as NSNumber;
return n == null ? double.NaN : n.DoubleValue;
return n?.DoubleValue ?? double.NaN;
}
}

Expand Down Expand Up @@ -81,9 +81,7 @@ public NSUrl? AssetUrl {
get {
// do not show an ArgumentNullException inside the
// debugger for releases before 6.0
if (_PropertyAssetURL == null)
return null;
return (NSUrl) ValueForProperty (_PropertyAssetURL);
return _PropertyAssetURL is not null ? (NSUrl) ValueForProperty (_PropertyAssetURL) : null;
}
}
}
Expand Down

0 comments on commit 6ce47be

Please sign in to comment.