Skip to content

Commit

Permalink
[assetslibrary] Add nullability to (generated and manual) bindings (#…
Browse files Browse the repository at this point in the history
…14222)

Co-authored-by: TJ Lambert <[email protected]>
  • Loading branch information
tj-devel709 and TJ Lambert authored Feb 23, 2022
1 parent 7af9f78 commit b2cc6d9
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

4 comments on commit b2cc6d9

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ [CI Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff

API Current PR diff

ℹ️ API Diff (from PR only) (please review changes)

View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff

Generator diff

Generator Diff (no change)

Packages generated

View packages

Test results

1 tests failed, 234 tests passed.

Failed tests

  • [NUnit] Mono Mac OS X BCL tests group 2/Mac Full/Debug: Failed (Test run failed.
    Tests run: 11943 Passed: 10500 Inconclusive: 0 Failed: 2 Ignored: 354)

Pipeline on Agent XAMMINI-070.BigSur'
[assetslibrary] Add nullability to (generated and manual) bindings (#14222)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Tests failed catastrophically on VSTS: device tests iOS 🔥

Not enough free space in the host.

Pipeline on Agent
[assetslibrary] Add nullability to (generated and manual) bindings (#14222)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Tests failed catastrophically on VSTS: device tests iOS (no summary found). 🔥

Result file D:\a\1\s\Reports\TestSummary-iOS64\TestSummary.md not found.

Pipeline on Agent
[assetslibrary] Add nullability to (generated and manual) bindings (#14222)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Tests failed catastrophically on VSTS: device tests tvOS (no summary found). 🔥

Result file D:\a\1\s\Reports\TestSummary-tvos\TestSummary.md not found.

Pipeline on Agent
[assetslibrary] Add nullability to (generated and manual) bindings (#14222)

Please sign in to comment.