From 317b28b5c55bfd736e8791bc8c60dcc328116adf Mon Sep 17 00:00:00 2001 From: Leigh Douglas Date: Thu, 5 Dec 2024 15:34:12 -0500 Subject: [PATCH] MBL-1922: Crash from lateinit variable viewModelFactory uninitialized in FacebookConfirmationActivity.kt (#2186) * initialize facebook confirmation viewmodel factory * linter * Revert test code --------- Co-authored-by: Leigh Douglas --- .../ui/activities/FacebookConfirmationActivity.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/com/kickstarter/ui/activities/FacebookConfirmationActivity.kt b/app/src/main/java/com/kickstarter/ui/activities/FacebookConfirmationActivity.kt index 543ba5d3d8..9a9f60ba75 100644 --- a/app/src/main/java/com/kickstarter/ui/activities/FacebookConfirmationActivity.kt +++ b/app/src/main/java/com/kickstarter/ui/activities/FacebookConfirmationActivity.kt @@ -11,6 +11,7 @@ import com.kickstarter.libs.utils.SwitchCompatUtils import com.kickstarter.libs.utils.TransitionUtils import com.kickstarter.libs.utils.ViewUtils import com.kickstarter.libs.utils.extensions.addToDisposable +import com.kickstarter.libs.utils.extensions.getEnvironment import com.kickstarter.utils.WindowInsetsUtil import com.kickstarter.viewmodels.FacebookConfirmationViewModel import io.reactivex.android.schedulers.AndroidSchedulers @@ -26,6 +27,10 @@ class FacebookConfirmationActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + this.getEnvironment()?.let { env -> + viewModelFactory = FacebookConfirmationViewModel.Factory(env) + } + binding = FacebookConfirmationLayoutBinding.inflate(layoutInflater) WindowInsetsUtil.manageEdgeToEdge( window,