Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PP-714: Make BottomNavigator bug non-fatal #258

Merged
merged 3 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README-CHANGES.xml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
<c:change date="2022-04-29T00:00:00+00:00" summary="Fixed &quot;Unable to initialize audio engine&quot; error playing some audio books."/>
</c:changes>
</c:release>
<c:release date="2023-11-10T10:00:46+00:00" is-open="true" ticket-system="org.lyrasis.jira" version="1.8.0">
<c:release date="2023-11-10T14:25:49+00:00" is-open="true" ticket-system="org.lyrasis.jira" version="1.8.0">
<c:changes>
<c:change date="2023-11-07T00:00:00+00:00" summary="Book sample buttons are no longer displayed for loaned books.">
<c:tickets>
Expand All @@ -388,7 +388,12 @@
</c:tickets>
</c:change>
<c:change date="2023-11-09T00:00:00+00:00" summary="Started using device registration URI from patron authentication document."/>
<c:change date="2023-11-10T10:00:46+00:00" summary="Updated notification calls to be run in a background thread."/>
<c:change date="2023-11-10T00:00:00+00:00" summary="Updated notification calls to be run in a background thread."/>
<c:change date="2023-11-10T14:25:49+00:00" summary="Prevent a crash caused by tabs and the back button.">
<c:tickets>
<c:ticket id="PP-714"/>
</c:tickets>
</c:change>
</c:changes>
</c:release>
</c:releases>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,17 @@ class TabbedNavigator private constructor(private val navigator: BottomNavigator
}

fun popBackStack(): Boolean {
return this.navigator.pop()
return try {
if (this.navigator.currentStackSize() < 1) {
this.logger.warn("Trying to pop an empty stack!")
false
} else {
this.navigator.pop()
}
} catch (e: Exception) {
logger.warn("Failed to pop navigator stack: ", e)
false
}
}

fun popToRoot(): Boolean {
Expand Down
Loading