Skip to content

Commit

Permalink
Merge pull request #260 from dart-lang/handle-null
Browse files Browse the repository at this point in the history
Handle null coverage range
  • Loading branch information
grouma committed Jul 18, 2019
2 parents 93b7d82 + a847925 commit ee986a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.13.1 - 2019-07-18

* Handle scenario where the VM returns empty coverage information for a range.

## 0.13.0 - 2019-07-10

* BREAKING CHANGE: Skips collecting coverage for `dart:` libaries by default,
Expand Down
3 changes: 3 additions & 0 deletions lib/src/collect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ Future<List<Map<String, dynamic>>> _getCoverageJson(VmService service,

// Collect hits and misses.
final coverage = range.coverage;

if (coverage == null) continue;

for (final tokenPos in coverage.hits) {
final line = _getLineFromTokenPos(script, tokenPos);
if (line == null) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: coverage
version: 0.13.0
version: 0.13.1
author: Dart Team <misc@dartlang.org>
description: Coverage data manipulation and formatting
homepage: https://github.com/dart-lang/coverage
Expand Down

0 comments on commit ee986a9

Please sign in to comment.