Skip to content

Commit

Permalink
Fixed crash on uninitialized allEvents property when deep-linking
Browse files Browse the repository at this point in the history
  • Loading branch information
s1g53gv committed Dec 17, 2024
1 parent 9281e9e commit a86e821
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class EventDetailsFragment : Fragment(), EventClickListener {
this@EventDetailsFragment)
})

private lateinit var allEvents: ArrayList<Event>
private var allEvents: List<Event> = emptyList()

private val suggestedEvents = arrayListOf<Event>()

Expand Down Expand Up @@ -140,17 +140,13 @@ class EventDetailsFragment : Fragment(), EventClickListener {
Status.SUCCESS -> {
val events = it.data
if (!events.isNullOrEmpty()) {
allEvents = events as ArrayList<Event>
allEvents = events
} else {
binding.tvInterestingForYou.isVisible = false
}
}

Status.ERROR -> {
}

Status.LOADING -> {
}
Status.ERROR -> Unit
Status.LOADING -> Unit
}
}

Expand Down

0 comments on commit a86e821

Please sign in to comment.