Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 594506a2 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

chore: fix crash due to empty array

parent 227acd80
Loading
Loading
Loading
Loading
Loading
+2 −16
Original line number Diff line number Diff line
@@ -58,8 +58,7 @@ class ReLoginWithOidcActivity : AppCompatActivity() {
        logoutAccount(accountName, accountRemovalCallback)
    }

    private fun logoutAccount(accountName: String,
                              callback : (AliasFuture) -> Unit)
    private fun logoutAccount(accountName: String, callback : (AliasFuture) -> Unit)
    {
        val accountManager = AccountManager.get(this)
        val eAccounts= accountManager.getAccountsByType(applicationContext.getString(R.string.eelo_account_type))
@@ -82,27 +81,14 @@ class ReLoginWithOidcActivity : AppCompatActivity() {

            accountManager.addAccount(eAccountType,
                null,
                arrayOf(),
                null,
                this,
                { future -> startAddAccount(future) },
                null
            )


            //todo only work for API 33 ?
            /*accountManager.startAddAccountSession(
                eAccountType,
                null,
                arrayOf(),
                null,
                this,
                { future -> startAddAccount(future) },
                null
            )*/
            )
        } catch (exception: AuthenticatorException) {
            Logger.log.info("Vincent: AuthenticatorException: can't add account: ${exception.message}")

        } catch (exception: IOException) {
            Logger.log.info("Vincent: IOException: can't add account: ${exception.message}")
        } catch (exception: OperationCancelledException) {