Skip to content

Commit

Permalink
Merge pull request #1152 from meenbeese/exception
Browse files Browse the repository at this point in the history
Fix IllegalStateException on app exit
  • Loading branch information
bitmold authored Jul 1, 2024
2 parents 93cd73a + 3c26bc8 commit 3e8e858
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions app/src/main/java/org/torproject/android/OrbotActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -215,21 +215,20 @@ class OrbotActivity : BaseActivity() {
allCircumventionAttemptsFailed = false
return
}
var shouldDoOffLayout = true
if (Prefs.getConnectionPathway().equals(Prefs.PATHWAY_SMART)) {
shouldDoOffLayout = false
if (!Prefs.getConnectionPathway().equals(Prefs.PATHWAY_SMART) && fragConnect.isAdded && fragConnect.context != null) {
fragConnect.doLayoutOff()
}
if (shouldDoOffLayout && fragConnect.isAdded) fragConnect.doLayoutOff()
} else fragConnect.doLayoutOff()
} else if (fragConnect.isAdded && fragConnect.context != null) {
fragConnect.doLayoutOff()
}
}

OrbotConstants.STATUS_STARTING -> fragConnect.doLayoutStarting(this@OrbotActivity)
OrbotConstants.STATUS_ON -> fragConnect.doLayoutOn(this@OrbotActivity)
OrbotConstants.STATUS_STARTING -> if (fragConnect.isAdded && fragConnect.context != null) fragConnect.doLayoutStarting(this@OrbotActivity)
OrbotConstants.STATUS_ON -> if (fragConnect.isAdded && fragConnect.context != null) fragConnect.doLayoutOn(this@OrbotActivity)
OrbotConstants.STATUS_STOPPING -> {}
}

previousReceivedTorStatus = status

}

OrbotConstants.LOCAL_ACTION_LOG -> {
Expand Down

0 comments on commit 3e8e858

Please sign in to comment.