Skip to content

Commit

Permalink
fix: App Crash during activation resolved (#2225)
Browse files Browse the repository at this point in the history
* .

* App crash during activation resolved using try and catch block
  • Loading branch information
Darkeye14 authored Nov 19, 2024
1 parent 15a98c3 commit ef08ef6
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,24 @@ fun ActivateScreen(
ActivateScreen(
state = state,
onActivate = {
val clientIdAsInt: Int = try {
id
} catch (e: Exception) {
0
}
when (activateType) {
Constants.ACTIVATE_CLIENT -> viewModel.activateClient(
clientId = id,
clientId = clientIdAsInt,
clientPayload = it
)

Constants.ACTIVATE_CENTER -> viewModel.activateCenter(
centerId = id,
centerId = clientIdAsInt,
centerPayload = it
)

Constants.ACTIVATE_GROUP -> viewModel.activateGroup(
groupId = id,
groupId = clientIdAsInt,
groupPayload = it
)

Expand Down

0 comments on commit ef08ef6

Please sign in to comment.