Skip to content

Commit 420172a

Browse files
authored
Merge pull request #985 from Caliburn-Micro/alert-autofix-71
Potential fix for code scanning alert no. 71: Nested 'if' statements can be combined
2 parents 4699cae + d940133 commit 420172a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Caliburn.Micro.Platform/Platforms/Xamarin.Forms/AttachedCollection.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ protected virtual void OnItemAdded(BindableObject item) {
5555
/// </summary>
5656
/// <param name="item">The item that was removed.</param>
5757
protected virtual void OnItemRemoved(BindableObject item) {
58-
if (item is IAttachedObject) {
59-
if (((IAttachedObject) item).AssociatedObject != null)
60-
((IAttachedObject) item).Detach();
58+
if (item is IAttachedObject && ((IAttachedObject) item).AssociatedObject != null) {
59+
((IAttachedObject) item).Detach();
6160
}
6261
}
6362

0 commit comments

Comments
 (0)