FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
130 stars 26 forks source link

null error on filters for fields that don't exist (date time fields specifically) #4892

Open aaronmt93 opened 1 week ago

aaronmt93 commented 1 week ago

Can we access your project?

Current Behavior

Using a filter to get a number of items from a list of documents. This is a new field in my app so not all documents have this field in firebase. However, instead of the filter conditions defaulting to false when I set the default values, I get a null and the page has a giant red error screen breaking the UI.

Expected Behavior

If the fields dont exist, the filters should return false without resulting in a breaking change

Steps to Reproduce

  1. add a text widget
  2. query a list of documents that have a date time field somewhere
  3. set the text to be equal to the number of items returned in a filtered set of documents
  4. set the filter to check if the date time field in the list of documents is greater than the date time field in the users document (this is my use case, though even if I compare it to a static date time like the global property current time I still get the error)
  5. for testing, make sure both of those date time fields don't exist
  6. even with default variable to false, still get the null error

Reproducible from Blank

Bug Report Code (Required)

IT4gismBy4x1obhK7aX6bu9V/T04JWIhaJc0rNlud0wdCePpEYkXds/CSxJtSOqHTH5YHmH9hk40+ujIjYSWKvZdNTWWQbpM/pBfUxDiIVGRVZS6BqiSQUcnJ+RnIBWD5re3rwhAVfFtL0I16mWUCdiuY3qCf9qOYwx5e6fDbOY=

Visual documentation

visual of the error IMG_2416

The following _TypeError was thrown building StreamBuilder<UsersRecord?>(dirty, state: _StreamBuilderBaseState<UsersRecord?, AsyncSnapshot<UsersRecord?>>#015e9): Null check operator used on a null value

visual of how the the setup looked for the filter in widget tree

Screenshot 2024-11-14 at 8 11 04 AM

Environment

- FlutterFlow version: 5.0.11
- Platform:Mac Desktop App
- Browser name and version: Chrome latest
- Operating system and version affected: Iphone IOS 18.0

Additional Information

if ever a field is null in the database and a page references that field, results in a complete break in the UI of the app

Alezanello commented 1 week ago

Hello!

Thank you for bringing this issue to our attention. I will pass it along to the engineering team for review and a potential fix.

github-actions[bot] commented 5 hours ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.