Skip to content

Commit

Permalink
fix: prevent full crash when returning from a force-quit state (#70)
Browse files Browse the repository at this point in the history
* prevent full crash when returning from a force-quit state

* Version incr for release
  • Loading branch information
carlpoole authored Jul 3, 2024
1 parent 2da5766 commit 971789d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ionic-portals-android",
"version": "0.10.1",
"version": "0.10.2",
"description": "Ionic Portals",
"homepage": "https://ionic.io/portals",
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
Expand Down

0 comments on commit 971789d

Please sign in to comment.