Skip to content

Commit

Permalink
Added null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
saamerm committed Jan 28, 2022
1 parent 7d53a5b commit 744117e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/StoreReview.Plugin/StoreReviewImplementation.apple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public Task RequestReview(bool testMode)
{
if (IsiOS14)
{
var windowScene = UIApplication.SharedApplication.ConnectedScenes.ToArray<UIScene>()?.First(x => x.ActivationState == UISceneActivationState.ForegroundActive) as UIWindowScene;
var windowScene = UIApplication.SharedApplication?.ConnectedScenes?.ToArray<UIScene>()?.FirstOrDefault(x => x.ActivationState == UISceneActivationState.ForegroundActive) as UIWindowScene;
if (windowScene != null)
{
SKStoreReviewController.RequestReview(windowScene);
Expand Down

0 comments on commit 744117e

Please sign in to comment.