Skip to content

Commit

Permalink
Don't throw exceptions if SemanticsOwnerListenerImpl.current is null,…
Browse files Browse the repository at this point in the history
… early exit instead (#1114)

## Proposed Changes

Replace throwing `SemanticsOwnerListenerImpl.current` check with early
exit check.

## Testing

Test: N/A

## Issues Fixed

Fixes: JetBrains/compose-multiplatform#4315
  • Loading branch information
elijah-semyonov authored Feb 17, 2024
1 parent 26355ba commit 40d79c4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private class SemanticsOwnerListenerImpl(
}

override fun onSemanticsOwnerRemoved(semanticsOwner: SemanticsOwner) {
val current = checkNotNull(current)
val current = current ?: return

if (current.first == semanticsOwner) {
current.second.dispose()
Expand Down

0 comments on commit 40d79c4

Please sign in to comment.