Skip to content

Commit

Permalink
prevent full crash when returning from a force-quit state
Browse files Browse the repository at this point in the history
  • Loading branch information
carlpoole committed Jul 3, 2024
1 parent 2da5766 commit 939f598
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,13 @@ open class PortalFragment : Fragment {

val existingPortalName = savedInstanceState?.getString(PORTAL_NAME, null)
if (existingPortalName != null && portal == null) {
portal = PortalManager.getPortal(existingPortalName)
try {
portal = PortalManager.getPortal(existingPortalName)
} catch (e: Exception) {
Logger.warn("Attempted to reload PortalFragment from App restore but portal not found.")
Logger.warn("No portal named $existingPortalName found in PortalManager to use.")
Logger.warn("Portal reload is unsuccessful. This is likely okay and safe to ignore if your app is returning from a force quit state.")
}
}

if (portal != null) {
Expand Down

0 comments on commit 939f598

Please sign in to comment.