We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c8dc643 + 749de37 commit 98a3fadCopy full SHA for 98a3fad
WordPress/src/main/java/org/wordpress/android/ui/uploads/UploadStarter.kt
@@ -178,7 +178,13 @@ class UploadStarter @Inject constructor(
178
)
179
}
180
} finally {
181
- mutex.unlock()
+ // If the job of the current coroutine is cancelled while the `lock()` call is suspended,
182
+ // it results in the mutex ending up unlocked.
183
+ // We introduced this check to prevent IllegalStateExceptions when `unlock` is called in those cases.
184
+ // See: https://github.com/wordpress-mobile/WordPress-Android/issues/17463
185
+ if (mutex.isLocked) {
186
+ mutex.unlock()
187
+ }
188
189
190
0 commit comments