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

Wrong type mapping #30

Open
0xHexE opened this issue Dec 4, 2024 · 0 comments
Open

Wrong type mapping #30

0xHexE opened this issue Dec 4, 2024 · 0 comments

Comments

@0xHexE
Copy link

0xHexE commented Dec 4, 2024

E/flutter (13978): [ERROR:flutter/runtime/dart_isolate.cc(1315)] Unhandled exception:
E/flutter (13978): type 'Null' is not a subtype of type 'bool' in type cast
E/flutter (13978): #0      UserTypeBot.fromJson (package:tdlib/src/api/objects/user_type_bot.dart:72:47)
E/flutter (13978): #1      UserType.fromJson (package:tdlib/src/api/objects/user_type.dart:25:28)
E/flutter (13978): #2      User.fromJson (package:tdlib/src/api/objects/user.dart:179:22)
E/flutter (13978): #3      UpdateUser.fromJson (package:tdlib/src/api/objects/update_user.dart:24:18)
E/flutter (13978): #4      ConvertExtensions.toTdObject (package:tdlib/src/api/extensions/convert_extensions.dart:3460:27)
E/flutter (13978): #5      receiveIsolateEntryPoint (package:tdlib/src/client/platform/io/receive_isolate_endpoint.dart:21:34)
E/flutter (13978): <asynchronous suspension>
return UserTypeBot(
      canBeEdited: json['can_be_edited'] as bool,
      canJoinGroups: json['can_join_groups'] as bool,
      canReadAllGroupMessages: json['can_read_all_group_messages'] as bool,
      hasMainWebApp: json['has_main_web_app'] as bool, // problem lies here. has_main_web_app not availabe in the json.
      isInline: json['is_inline'] as bool,
      inlineQueryPlaceholder: json['inline_query_placeholder'] as String,
      needLocation: json['need_location'] as bool,
      canConnectToBusiness: json['can_connect_to_business'] as bool,
      canBeAddedToAttachmentMenu:
          json['can_be_added_to_attachment_menu'] as bool,
      activeUserCount: json['active_user_count'] as int,
    );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant