Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.

Fix empty list exception#10

Open
lngyeen wants to merge 1 commit into
Muljin:masterfrom
openwt:bugfix/fix-empty-list-exception
Open

Fix empty list exception#10
lngyeen wants to merge 1 commit into
Muljin:masterfrom
openwt:bugfix/fix-empty-list-exception

Conversation

@lngyeen

@lngyeen lngyeen commented Aug 4, 2022

Copy link
Copy Markdown

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

mswehli commented Aug 9, 2022

Copy link
Copy Markdown
Contributor

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

lngyeen commented Aug 23, 2022

Copy link
Copy Markdown
Author

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants