From d6c8fd35d84e4d9a3fc89113505cf6950d6efac2 Mon Sep 17 00:00:00 2001 From: Can Erten Date: Fri, 10 Jan 2014 08:35:37 +0000 Subject: [PATCH] exception handling --- Mac/Appirater.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Mac/Appirater.cs b/Mac/Appirater.cs index 16df8b0..2de5650 100644 --- a/Mac/Appirater.cs +++ b/Mac/Appirater.cs @@ -406,21 +406,29 @@ void IncrementSignificantEventCount () [Export(SELECTOR_INCREMENT_AND_RATE)] void IncrementAndRate (NSNumber _canPromptForRating) { - using (new NSAutoreleasePool ()) { - IncrementUseCount (); - if (_canPromptForRating.BoolValue && RatingConditionsHaveBeenMet () && ConnectedToNetwork ()) - InvokeOnMainThread (ShowRatingAlert); + try { + using (new NSAutoreleasePool ()) { + IncrementUseCount (); + if (_canPromptForRating.BoolValue && RatingConditionsHaveBeenMet () && ConnectedToNetwork ()) + InvokeOnMainThread (ShowRatingAlert); + } + } + catch { } } [Export(SELECTOR_INCREMENT_EVENT_AND_RATE)] void IncrementSignificantEventAndRate (NSNumber _canPromptForRating) { + try { using (new NSAutoreleasePool ()) { IncrementSignificantEventCount (); if (_canPromptForRating.BoolValue && RatingConditionsHaveBeenMet () && ConnectedToNetwork ()) InvokeOnMainThread (ShowRatingAlert); } + } + catch { + } }