🐛 Bug Report: Getting java.lang.NullPointerException when using Query.select on attributes along with limit query

Aperta
#56 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
kotlin
Ambito
mobile-dev

Direzione di ricerca

Il report cita l’entry point listDocuments, Query.select e Query.toJson(); individua la classe Query e traccia la serializzazione di una query limitata con attributi forniti dinamicamente. Riproduci il fallimento del cast da null a Kotlin-String, quindi verifica che la stessa query venga serializzata senza l’eccezione e aggiungi un test di regressione mirato, se il repository ne fornisce uno.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
👟 Reproduction steps
  1. Call the listDocuments function with parameters that include database and collection IDs, a numeric limit, and a list of attributes.
  2. Include attribute selection in the query, where attribute names are passed dynamically to the Query.select method.
  3. Execute the function, which internally calls toJson() on the Query object.
👍 Expected behavior

Expected Behavior:
The function should handle null values gracefully and not attempt to cast nulls to non-null strings. If a parameter is null, it should either be managed by default values or handled with appropriate error messages.

👎 Actual Behavior

Actual Behavior:
The application throws a java.lang.NullPointerException: null cannot be cast to non-null type kotlin.String during the execution of the toJson() method in the Query class. This error suggests that there might be issues with how null values are being managed within query parameters or during their serialization/deserialization process.

🎲 Appwrite version

Version 1.5.x

💻 Operating system

Linux

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?
  • I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
Lingua principale
Kotlin
Stelle
156
Fork
29
Merge medio
8h 49m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di appwrite/sdk-for-android

Tutte le issue di appwrite/sdk-for-android

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.