-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Bug Report: NullPointerException when trying to fetch teams list #30
Comments
Hey @Narmo, in this case, |
@Narmo Please check if the migration was run, that should be adding the default values for team prefs: https://appwrite.io/docs/upgrade#migration |
@abnegate Sorry, my mistake. We did not update the server instance to latest (1.3.7) version. After the update and migration everything works fine with latest SDK version. So I think that this ticket can be closed now. |
@Narmo Awesome glad it's sorted 😁 |
👟 Reproduction steps
When I try to fetch teams list using
Teams
object, I get NPE.Demo code:
👍 Expected behavior
Teams list should load.
👎 Actual Behavior
The call crashes with following stack trace:
I've investigated the crash and found the point. The error occurs in mapping the
Team
object's preferences inTeam.kt
file:In last line, where
prefs
is assigned, actual value ofmaps["prefs"]
isnull
, while cast expects it to beMap<String, Any>
. So theprefs
field indata class Team
should be nullable, and I suggest that the cast should be rewritten, something like that:🎲 Appwrite version
Version 1.3.x
💻 Operating system
MacOS
🧱 Your Environment
I use
io.appwrite:sdk-for-kotlin:2.0.0
which automatically fetches all required dependencies.👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: