Skip to content

Commit

Permalink
Don't stop if starting Tor was cancelled already
Browse files Browse the repository at this point in the history
  • Loading branch information
grote committed Jun 26, 2023
1 parent dd0c58a commit 17c8c87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/main/java/org/onionshare/android/ShareManager.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.onionshare.android

import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Job
Expand Down Expand Up @@ -84,7 +85,9 @@ class ShareManager @Inject constructor(
torManager.start()
} catch (e: Exception) {
LOG.error("Error starting Tor: ", e)
stopOnError(ShareUiState.ErrorStarting(errorMsg = e.toString()))
if (e !is CancellationException) {
stopOnError(ShareUiState.ErrorStarting(errorMsg = e.toString()))
}
}
}
// wait for tor.start() to return before starting to observe, actual startup happens async
Expand Down

0 comments on commit 17c8c87

Please sign in to comment.