ERP-Ukraine / odoo-rpc-dart

Odoo RPC Library for Dart
MIT License
43 stars 32 forks source link

orpc.authenticate raise a null pointer exception #48

Closed nafarrin closed 4 months ago

nafarrin commented 5 months ago

flutter: ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: │ #0 main (package:odoo_rpc_flutter_demo/main.dart:54:12) flutter: │ #1 flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ flutter: │ 💡 Logging with credentials flutter: └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Null' is not a subtype of type 'int' in type cast

0 OdooSession.fromSessionInfo (package:odoo_rpc/src/odoo_session.dart:65:37)

1 OdooClient.authenticate (package:odoo_rpc/src/odoo_client.dart:261:32)

#2 main (package:odoo_rpc_flutter_demo/main.dart:55:5)
isyedaliraza commented 5 months ago

Odoo 17 might changed something. Try to connect with Odoo 16 server.

nafarrin commented 5 months ago

thanks for the answer, unfortunately that's not an option in odoo cloud

isyedaliraza commented 5 months ago

I came across the same issue. I looked at the code and found there is some problem with parsing OdooSession. In Odoo 17, the /web/session/authenticate response doesn't contain the company_id key.

lem8r commented 4 months ago

Thanks for reporting! Please upgrade to v0.5.4