Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #866 from breyed/patch-2
Browse files Browse the repository at this point in the history
Fix crash on double cancel
  • Loading branch information
jamesmontemagno authored Jun 9, 2020
2 parents ec1c24b + 72bce99 commit 4b57e71
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Media.Plugin/iOS/MediaPickerDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public UIPopoverController Popover
set;
}

public void CancelTask() => tcs.SetResult(null);
public void CancelTask() => tcs.TrySetResult(null);

public UIView View => viewController.View;

Expand Down Expand Up @@ -91,7 +91,7 @@ public void Canceled(UINavigationController picker)

Dismiss(picker, () =>
{
tcs.SetResult(null);
tcs.TrySetResult(null);
});
}

Expand All @@ -106,7 +106,7 @@ public override void Canceled(UIImagePickerController picker)

Dismiss(picker, () =>
{
tcs.SetResult(null);
tcs.TrySetResult(null);
});
}

Expand Down

0 comments on commit 4b57e71

Please sign in to comment.