From 88ac87ecb9a1530c61617bf2ed1ad29e40a2fb60 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sat, 5 Jan 2019 12:59:09 +0000 Subject: [PATCH] ObservableValue now works with null --- .../java/net/ktnx/mobileledger/model/ObservableValue.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.39.5