]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java
fix a crash when returning to new transaction with no focused input
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / new_transaction / NewTransactionModel.java
index 426cb0417300b51e52116fae6d9dd9463ca0c474..81f1ed07ae7d4d20753cc0304918be903cdec1a5 100644 (file)
@@ -370,7 +370,7 @@ public class NewTransactionModel extends ViewModel {
             noteFocusChanged(fi.position - 1, fi.element);
         setItems(newList);
     }
             noteFocusChanged(fi.position - 1, fi.element);
         setItems(newList);
     }
-    void noteFocusChanged(int position, FocusedElement element) {
+    void noteFocusChanged(int position, @Nullable FocusedElement element) {
         FocusInfo present = focusInfo.getValue();
         if (present == null || present.position != position || present.element != element)
             focusInfo.setValue(new FocusInfo(position, element));
         FocusInfo present = focusInfo.getValue();
         if (present == null || present.position != position || present.element != element)
             focusInfo.setValue(new FocusInfo(position, element));
@@ -896,7 +896,7 @@ public class NewTransactionModel extends ViewModel {
     public static class FocusInfo {
         int position;
         FocusedElement element;
     public static class FocusInfo {
         int position;
         FocusedElement element;
-        public FocusInfo(int position, FocusedElement element) {
+        public FocusInfo(int position, @Nullable FocusedElement element) {
             this.position = position;
             this.element = element;
         }
             this.position = position;
             this.element = element;
         }