From f33ca2b5d398fede0db841db5287e0d45702eb0c Mon Sep 17 00:00:00 2001
From: vjrj <vjrj@comunes.org>
Date: Wed, 5 Apr 2023 23:32:06 +0200
Subject: [PATCH] Fix fow NPE

---
 lib/ui/widgets/first_screen/pay_contact_search_page.dart | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/ui/widgets/first_screen/pay_contact_search_page.dart b/lib/ui/widgets/first_screen/pay_contact_search_page.dart
index a225daab..a6e7ed01 100644
--- a/lib/ui/widgets/first_screen/pay_contact_search_page.dart
+++ b/lib/ui/widgets/first_screen/pay_contact_search_page.dart
@@ -148,10 +148,11 @@ class _PayContactSearchPageState extends State<PayContactSearchPage> {
                   if (_results.length == 1 && pay != null) {
                     final Contact contact = _results[0];
                     paymentCubit.selectUser(contact, pay.amount);
-                  } else if (pay!.amount != null) {
-                    paymentCubit.selectKeyAmount(pay.contact!, pay.amount!);
-                  } else {
-                    paymentCubit.selectKey(pay.contact);
+                    if (pay.amount != null) {
+                      paymentCubit.selectKeyAmount(contact, pay.amount!);
+                    } else {
+                      paymentCubit.selectKey(contact);
+                    }
                   }
                   if (!mounted) {
                     return;
-- 
GitLab