Skip to content

Commit

Permalink
Merge pull request #20450 from wordpress-mobile/issue/20354-fix-crash…
Browse files Browse the repository at this point in the history
…-on-domain-selection-screen

Fix crash on the domain selection screen
  • Loading branch information
ravishanker authored Mar 13, 2024
2 parents aeb40f8 + bf0c79c commit 08ec9e7
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,10 @@ class SiteCreationDomainsViewModel @Inject constructor(
}

fun onCreateSiteBtnClicked() {
val domain = requireNotNull(selectedDomain) {
"Create site button should not be visible if a domain is not selected"
}
tracker.trackDomainSelected(domain.domainName, currentQuery?.value.orEmpty(), domain.cost, domain.isFree)
_createSiteBtnClicked.value = domain
selectedDomain?.let { domain ->
tracker.trackDomainSelected(domain.domainName, currentQuery?.value.orEmpty(), domain.cost, domain.isFree)
_createSiteBtnClicked.value = domain
} // selectedDomain is null if the query has been asynchronously updated and the domain list has been changed.
}

fun onClearTextBtnClicked() = _clearBtnClicked.call()
Expand Down

0 comments on commit 08ec9e7

Please sign in to comment.