Skip to content

[firebase-database][iOS] attempt to insert nil object from objects[0] #105

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

Closed
danouche93 opened this issue Jul 28, 2022 · 3 comments
Closed
Labels
bug Something isn't working ios

Comments

@danouche93
Copy link

Hi, I use this new plugin of firebase because the old one is deprecated. Thank you for developing this !
I open this ticket because I have an issue when setting a value in Firebase Database. When the object I send has one or more properties that are null, I get the error ERROR Error: Uncaught (in promise): Error: *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0] and the object is not send.
This issue only occurs in iOS. In Android it is working fine, whenever there are null properties, it is not sent to the database, it would be great to have the same behavior. I use NativeScript with Angular.

Nativescript : 8.2.3
Package.json

{
  "name": "TinaAppV2",
  "main": "./src/main.ts",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@angular/animations": "~13.2.0",
    "@angular/common": "~13.2.0",
    "@angular/compiler": "~13.2.0",
    "@angular/core": "~13.2.0",
    "@angular/forms": "~13.2.0",
    "@angular/platform-browser": "~13.2.0",
    "@angular/platform-browser-dynamic": "~13.2.0",
    "@angular/router": "~13.2.0",
    "@nativescript-community/ui-pulltorefresh": "^2.5.1",
    "@nativescript/angular": "^13.0.0",
    "@nativescript/core": "~8.2.2",
    "@nativescript/datetimepicker": "^2.1.9",
    "@nativescript/firebase-core": "^2.1.0",
    "@nativescript/firebase-crashlytics": "^2.1.0",
    "@nativescript/firebase-database": "^2.1.0",
    "@nativescript/firebase-messaging": "^2.1.0",
    "@nativescript/geolocation": "^8.0.2",
    "@nativescript/mlkit-barcode-scanning": "^1.0.5",
    "@nativescript/mlkit-core": "^1.0.5",
    "@nativescript/theme": "~3.0.2",
    "@nstudio/nativescript-checkbox": "^2.0.5",
    "@nstudio/nativescript-floatingactionbutton": "^3.0.4",
    "nativescript-forgm-sound": "^1.1.3",
    "nativescript-ui-chart": "^9.0.2",
    "nativescript-ui-sidedrawer": "^10.0.2",
    "rxjs": "~7.5.0",
    "zone.js": "~0.11.5"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^13.3.6",
    "@angular/compiler-cli": "~13.2.0",
    "@nativescript/android": "8.2.2",
    "@nativescript/ios": "8.2.3",
    "@nativescript/types": "~8.2.0",
    "@nativescript/webpack": "~5.0.6",
    "@ngtools/webpack": "~13.2.0",
    "typescript": "~4.5.5"
  }
}
@triniwiz triniwiz added bug Something isn't working ios labels Jul 28, 2022
@danouche93
Copy link
Author

Thank you for releasing an update for this. Unfortunately I still have the issue :(
@triniwiz

@triniwiz
Copy link
Member

Can you send me some sample data

@danouche93
Copy link
Author

The object I sent to firebase is the value I get from my API. I've noticed it happens when the null value is in a list like :
var obj = { "list": [{ "propertyA": "valueA", "propertyB": null }, { "propertyA": "aaa", "propertyB": null }] }; firebase().database().ref(path).set(obj);

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

No branches or pull requests

2 participants