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

オープン
#56 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
kotlin
領域
mobile-dev

調査の方向性

レポートでは listDocuments エントリポイント、Query.select、Query.toJson() が挙げられています。Query クラスを見つけ、動的に指定された属性を持つ限定的なクエリのシリアライズを追跡してください。null から Kotlin-String へのキャスト失敗を再現し、その後、同じクエリが例外なしでシリアライズされることを確認し、リポジトリに用意されている場合は焦点を絞った回帰テストを追加してください。

索引モデルが issue の本文から書いたものです。

説明

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?
主要言語
Kotlin
スター
156
フォーク
29
平均マージ
8時間 49分
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

appwrite/sdk-for-android のほかの issue

appwrite/sdk-for-android の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。