diff --git a/app/src/google/java/org/traccar/client/GoogleMainApplication.kt b/app/src/google/java/org/traccar/client/GoogleMainApplication.kt index d46e89ae..b7d5eed2 100644 --- a/app/src/google/java/org/traccar/client/GoogleMainApplication.kt +++ b/app/src/google/java/org/traccar/client/GoogleMainApplication.kt @@ -47,10 +47,13 @@ class GoogleMainApplication : MainApplication() { if (!ratingShown && totalDuration > RATING_THRESHOLD) { val reviewManager = ReviewManagerFactory.create(activity) reviewManager.requestReviewFlow().addOnCompleteListener { infoTask: Task -> - val reviewInfo = infoTask.result - if (infoTask.isSuccessful && reviewInfo != null) { - val flow = reviewManager.launchReviewFlow(activity, reviewInfo) - flow.addOnCompleteListener { preferences.edit().putBoolean(KEY_RATING_SHOWN, true).apply() } + if (infoTask.isSuccessful) { + val reviewInfo = infoTask.result + if (reviewInfo != null) { + reviewManager.launchReviewFlow(activity, reviewInfo).addOnCompleteListener { + preferences.edit().putBoolean(KEY_RATING_SHOWN, true).apply() + } + } } } }