Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 5514cc9

Browse files
committed
Added nullability checks
1 parent a402fd1 commit 5514cc9

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Platform.Handlers/src/Xamarin.Platform.Handlers/Handlers/CheckBox/CheckBoxHandler.iOS.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,10 @@ public override Size GetDesiredSize(double widthConstraint, double heightConstra
6464
return size;
6565
}
6666

67-
void OnCheckedChanged(object sender, EventArgs e)
67+
void OnCheckedChanged(object? sender, EventArgs e)
6868
{
69-
if (VirtualView != null)
69+
if (sender is NativeCheckBox nativeView && VirtualView != null)
7070
{
71-
var nativeView = (NativeCheckBox)sender;
7271
VirtualView.IsChecked = nativeView.IsChecked;
7372
}
7473
}

src/Platform.Handlers/src/Xamarin.Platform.Handlers/Platform/iOS/NativeCheckBox.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ public NativeCheckBox()
4545
TouchUpInside += OnTouchUpInside;
4646
}
4747

48-
void OnTouchUpInside(object sender, EventArgs e)
48+
void OnTouchUpInside(object? sender, EventArgs e)
4949
{
5050
IsChecked = !IsChecked;
51-
CheckedChanged?.Invoke(this, null);
51+
CheckedChanged?.Invoke(this, EventArgs.Empty);
5252
}
5353

5454
public bool IsChecked

0 commit comments

Comments
 (0)