Skip to content

Commit

Permalink
MBL-1922: Crash from lateinit variable viewModelFactory uninitialized…
Browse files Browse the repository at this point in the history
… in FacebookConfirmationActivity.kt (#2186)

* initialize facebook confirmation viewmodel factory

* linter

* Revert test code

---------

Co-authored-by: Leigh Douglas <[email protected]>
  • Loading branch information
leighdouglas and Leigh Douglas authored Dec 5, 2024
1 parent 9b8b8f6 commit 317b28b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 317b28b

Please sign in to comment.