From 9eb5a6b1b99bb306cce8d04856e5eb2d54cdc5e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Mon, 12 Nov 2018 14:57:44 +0100 Subject: [PATCH] fix NPE --- .../simplecloudnotifier/view/NotificationsFragment.java | 2 +- .../simplecloudnotifier/view/SettingsFragment.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/NotificationsFragment.java b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/NotificationsFragment.java index f752ccc..0557e06 100644 --- a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/NotificationsFragment.java +++ b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/NotificationsFragment.java @@ -45,6 +45,6 @@ public class NotificationsFragment extends Fragment public void updateProState() { - adView.setVisibility(IABService.inst().getPurchaseCached(IABService.IAB_PRO_MODE) != null ? View.GONE : View.VISIBLE); + if (adView != null) adView.setVisibility(IABService.inst().getPurchaseCached(IABService.IAB_PRO_MODE) != null ? View.GONE : View.VISIBLE); } } diff --git a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/SettingsFragment.java b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/SettingsFragment.java index 43676ca..647658a 100644 --- a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/SettingsFragment.java +++ b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/SettingsFragment.java @@ -213,9 +213,9 @@ public class SettingsFragment extends Fragment implements MusicPickerListener { Purchase p = IABService.inst().getPurchaseCached(IABService.IAB_PRO_MODE); - prefUpgradeAccount.setVisibility( p != null ? View.GONE : View.VISIBLE); - prefUpgradeAccount_info.setVisibility(p != null ? View.GONE : View.VISIBLE); - prefUpgradeAccount_msg.setVisibility( p != null ? View.VISIBLE : View.GONE ); + if (prefUpgradeAccount != null) prefUpgradeAccount.setVisibility( p != null ? View.GONE : View.VISIBLE); + if (prefUpgradeAccount_info != null) prefUpgradeAccount_info.setVisibility(p != null ? View.GONE : View.VISIBLE); + if (prefUpgradeAccount_msg != null) prefUpgradeAccount_msg.setVisibility( p != null ? View.VISIBLE : View.GONE ); } private int getCacheSizeIndex(int value)