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

RepositoryCommit fails, type cast error #139

Closed
madisona opened this issue Mar 1, 2019 · 1 comment · Fixed by #140
Closed

RepositoryCommit fails, type cast error #139

madisona opened this issue Mar 1, 2019 · 1 comment · Fixed by #140

Comments

@madisona
Copy link
Contributor

madisona commented Mar 1, 2019

Similar to #124

import 'dart:async';
import 'package:github/server.dart';

void main() async {
  GitHub github =
      createGitHubClient(auth: new Authentication.withToken(myToken));
  RepositorySlug slug = RepositorySlug("flutter", "flutter");
  Stream<RepositoryCommit> commitResults =
      github.repositories.listCommits(slug);

  await for (RepositoryCommit commit in commitResults) {
    print(commit.commit.message);
  }
}

gives:

$ ./bin/github_bug.dart 
Unhandled exception:
type 'List<dynamic>' is not a subtype of type 'List<Map<String, dynamic>>' in type cast
#0      RepositoryCommit.fromJSON (file:///Users/amadison/.pub-cache/git/github.dart-25a5e78f4cc068f9a3dd544cb2d834ecff336972/lib/src/common/model/repos_commits.dart:55:42)
#1      _MapStream._handleData (dart:async/stream_pipe.dart:227:21)
@tk103331
Copy link

tk103331 commented Jun 6, 2019

i got the same error

image

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

Successfully merging a pull request may close this issue.

2 participants