Skip to content

Commit

Permalink
Resolved null check warnings in Behavior class
Browse files Browse the repository at this point in the history
  • Loading branch information
VishalOmprasad committed Apr 22, 2024
1 parent e04a08e commit 8b5c9fc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace ImageEditorPenAnnotation
{
public class ImageEditorBehavior : Behavior<ContentPage>
{
SfImageEditor editor;
private SfImageEditor? editor;

protected override void OnAttachedTo(ContentPage bindable)
{
Expand All @@ -25,9 +25,9 @@ private void Editor_AnnotationSelected(object? sender, AnnotationSelectedEventAr
protected override void OnDetachingFrom(ContentPage bindable)
{
base.OnDetachingFrom(bindable);
this.editor.AnnotationSelected -= Editor_AnnotationSelected;
if (editor != null)
{
this.editor.AnnotationSelected -= Editor_AnnotationSelected;
this.editor = null;
}
}
Expand Down

0 comments on commit 8b5c9fc

Please sign in to comment.