Skip to content

Conversation

@lngyeen
Copy link

@lngyeen lngyeen commented Aug 4, 2022

java.util.NoSuchElementException: List is empty.
at kotlin.collections.CollectionsKt___CollectionsKt.first(_Collections.kt:212)
at uk.co.moodio.msal_flutter.MsalFlutterPlugin.clearAccounts(MsalFlutterPlugin.kt:157)

java.util.NoSuchElementException: List is empty.
at kotlin.collections.CollectionsKt___CollectionsKt.first(_Collections.kt:212)
at uk.co.moodio.msal_flutter.MsalFlutterPlugin.clearAccounts(MsalFlutterPlugin.kt:157)
@mswehli
Copy link
Contributor

mswehli commented Aug 9, 2022

Hi @lngyeen thanks for the PR.
Can you give a bit more context in when you got the exception? As we already check to make sure the account list is not empty with the any() function call, so the issue might be caused by something else such as parallel calls

@lngyeen
Copy link
Author

lngyeen commented Aug 23, 2022

@mswehli The exception occurred when I try to sign out right after signing in, not always but sometimes.
Another point is, take a look at msalApp.accounts, you can see that is a computed property (not stored property), that mean the msalApp.account on line 156 may be different from line 157.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants