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 occurred in Repository.fromJson() #384

Open
Whiterzi opened this issue Aug 11, 2023 · 1 comment
Open

Error occurred in Repository.fromJson() #384

Whiterzi opened this issue Aug 11, 2023 · 1 comment

Comments

@Whiterzi
Copy link

Whiterzi commented Aug 11, 2023

the error occurred in 9.12+ version.

Cause: type 'String' is not a subtype of type 'Map<String, dynamic>' in type cast
#0      _$RepositoryFromJson (package:github/src/common/model/repos.g.dart:129:48)
#1      new Repository.fromJson (package:github/src/common/model/repos.dart:454:7)

it seems the error is caused by the following code

organization: json['organization'] == null
? null
: User.fromJson(json['organization'] as Map<String, dynamic>),

the type of organization in json is String, so the error happened.

@github-actions
Copy link

👋 Thanks for reporting! @robrbecker will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant