Fix Nextcloud logout when server is no longer reachable

Close #1527
This commit is contained in:
MM20 2025-07-19 19:11:03 +02:00
parent 004fd7646b
commit c212d90408
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -231,8 +231,12 @@ class NextcloudApiHelper(val context: Context) {
.url("$server/ocs/v2.php/core/apppassword") .url("$server/ocs/v2.php/core/apppassword")
.build() .build()
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
val response = httpClient.newCall(request).execute() try {
response val response = httpClient.newCall(request).execute()
response
} catch (e: IOException) {
Log.e("NextcloudApiHelper", "Error during Nextcloud logout", e)
}
} }
preferences.edit { preferences.edit {
putString("server", null) putString("server", null)