From c13fc9d92974ebf3fa8c4a787244cbe8ed551a50 Mon Sep 17 00:00:00 2001 From: Gideon Okuro Date: Mon, 8 Apr 2024 19:25:09 +0300 Subject: [PATCH] feedback: safer call operator (fixes #3359) (#3362) Co-authored-by: dogi --- app/build.gradle | 4 ++-- .../org/ole/planet/myplanet/ui/feedback/FeedbackFragment.kt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 825c889577..00181c484a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 21 targetSdkVersion 34 - versionCode 1473 - versionName "0.14.73" + versionCode 1474 + versionName "0.14.74" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/feedback/FeedbackFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/feedback/FeedbackFragment.kt index f42741d7ab..882bb888f7 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/feedback/FeedbackFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/feedback/FeedbackFragment.kt @@ -24,7 +24,7 @@ class FeedbackFragment : DialogFragment(), View.OnClickListener { private lateinit var fragmentFeedbackBinding: FragmentFeedbackBinding private lateinit var mRealm: Realm private lateinit var databaseService: DatabaseService - private lateinit var model: RealmUserModel + private var model: RealmUserModel ?= null var user: String? = "" interface OnFeedbackSubmittedListener { @@ -45,8 +45,8 @@ class FeedbackFragment : DialogFragment(), View.OnClickListener { fragmentFeedbackBinding = FragmentFeedbackBinding.inflate(inflater, container, false) databaseService = DatabaseService(requireActivity()) mRealm = databaseService.realmInstance - model = UserProfileDbHandler(requireContext()).userModel!! - user = model.name + model = UserProfileDbHandler(requireContext()).userModel + user = model?.name fragmentFeedbackBinding.btnSubmit.setOnClickListener(this) fragmentFeedbackBinding.btnCancel.setOnClickListener(this) return fragmentFeedbackBinding.root