Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

null returned from data in get() request of a non-existant firestore node #395

Open
@halvorsen

Description

@halvorsen

I can get a null from this snapshot data when there is nothing at the document node i'm calling get() on. However snapshot.data() is not labeled as an optional.
final snapshot = await StorageCloudWeb.pathHelper.userBrowseInfoDocumentReference(userId).get().catchError((_) {});
final data = snapshot.data();
// data = null

using: firebase: ^9.0.1 (labeled as null safe)

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.3.1 20E241 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.58.0)
[✓] Connected device (2 available)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions