From ad0c14e3891c33988f9bd6a5bf4f43ade5a8446c Mon Sep 17 00:00:00 2001 From: dtvv Date: Sat, 29 Sep 2018 20:51:47 -0500 Subject: [PATCH] Prevent null pointer exception --- .../crystalwallet/views/CryptoNetBalanceViewHolder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetBalanceViewHolder.java b/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetBalanceViewHolder.java index 1596577..4a2e126 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetBalanceViewHolder.java +++ b/app/src/main/java/cy/agorise/crystalwallet/views/CryptoNetBalanceViewHolder.java @@ -125,7 +125,9 @@ public class CryptoNetBalanceViewHolder extends RecyclerView.ViewHolder { preferedCurrencySetting.observe((LifecycleOwner)this.itemView.getContext(), new Observer() { @Override public void onChanged(@Nullable GeneralSetting generalSetting) { - preferredCurrency = generalSetting.getValue(); + if(generalSetting != null){ + preferredCurrency = generalSetting.getValue(); + } } });