From: Damyan Ivanov Date: Sat, 5 Jan 2019 12:59:09 +0000 (+0000) Subject: ObservableValue now works with null X-Git-Tag: v0.3~117 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=88ac87ecb9a1530c61617bf2ed1ad29e40a2fb60;p=mobile-ledger.git ObservableValue now works with null --- diff --git a/app/src/main/java/net/ktnx/mobileledger/model/ObservableValue.java b/app/src/main/java/net/ktnx/mobileledger/model/ObservableValue.java index 9a4bb27a..46328157 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/ObservableValue.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/ObservableValue.java @@ -59,7 +59,9 @@ public class ObservableValue { setValue(newValue, true); } private synchronized void setValue(T newValue, boolean notify) { - if (newValue.equals(value)) return; + if ((newValue == null) && (value == null)) return; + + if ((newValue != null) && newValue.equals(value)) return; T oldValue = value; value = newValue;