Skip to content
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

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value. #121

Open
infinite-dev22 opened this issue Sep 12, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@infinite-dev22
Copy link

What bug do you experience? 🐞

When trying to create a room,I get an error: Null check operator used on a null value.

How can it be reproduced? 🤔

  1. Create a User.
  2. Create a room.
  3. Error occurs at Step 2.

What behavior is expected? 💡

A new chat room is created.


Screenshots or videos 📸

Screenshot from 2023-09-13 01-01-35

Code snippets 📝

types.User user = types.User(
  firstName: userProfile.name,
  id: userProfile.userId, // UID from Firebase Authentication
  imageUrl: userProfile.profilePicture,
  lastName: '',
);

await FirebaseChatCore.instance.createUserInFirestore(user);

final room = await FirebaseChatCore.instance.createRoom(user, metadata: { // Error occurs here.
  'imageUrl': userProfile.profilePicture,
  'name': userProfile.name,
  'listingId': widget.listing.id,
  'listingName': widget.listing.name,
});

Environment info

Please specify the flutter, flutter_firebase_chat_core versions.

flutter: 3.13.0
flutter_firebase_chat_core: 1.6.7

flutter doctor -v output 👇

[✓] Flutter (Channel stable, 3.13.0, on Ubuntu Mantic Minotaur (development branch) 6.5.1-060501-generic, locale en_US.UTF-8)
    • Flutter version 3.13.0 on channel stable at /home/infinite/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision efbf63d9c6 (4 weeks ago), 2023-08-15 21:05:06 -0500
    • Engine revision 1ac611c64e
    • Dart version 3.1.0
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /home/infinite/Android/Sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /home/infinite/.local/share/JetBrains/Toolbox/apps/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.8+0-17.0.8b1000.8-10699129)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[✓] Android Studio (version 2023.2)
    • Android Studio at /home/infinite/.local/share/JetBrains/Toolbox/apps/android-studio
    • Flutter plugin version 75.1.4
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.8+0-17.0.8b1000.8-10699129)

[✓] IntelliJ IDEA Community Edition (version 2023.2)
    • IntelliJ at /home/infinite/.local/share/JetBrains/Toolbox/apps/intellij-idea-community-edition
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.82.1)
    • VS Code at /usr/share/code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • F 04K (mobile)  • 578024c9 • android-arm64  • Android 10 (API 29)
    • Linux (desktop) • linux    • linux-x64      • Ubuntu Mantic Minotaur (development branch) 6.5.1-060501-generic
    • Chrome (web)    • chrome   • web-javascript • Google Chrome 116.0.5845.187

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Platform

Device (e.g. Android emulator, iOS simulator, Samsung Galaxy S21): Fujitsu F 04K

OS version (e.g. iOS 14.5, Android 11): Android 10

@infinite-dev22 infinite-dev22 added the bug Something isn't working label Sep 12, 2023
@ghost
Copy link

ghost commented Nov 27, 2023

same issue. Any news ?

@demchenkoalex
Copy link
Member

demchenkoalex commented Nov 28, 2023

I am working on a new chat UI version with a complete from scratch refactor, and this repo will become an example on how to use chat UI with Firebase. The package itself will be discontinued, since it does not make sense - core of the package is like 100 lines, if we remove all the customisation.

@JohannPie
Copy link

same issue

@himsarevenus
Copy link

any update on this ?

@sheanie
Copy link

sheanie commented Jan 19, 2024

I had a similar issue, although likely not the same, but it was caused by the code not being able to get the user out of firebase.

@igbokwenu
Copy link

I had the same issue. It was caused by deleting a firebase user without removing their uid from the uids of the rooms participants. Always remove a users uid from the room before deleting their account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants