Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
fix: unhandled exception while parsing analysis_options.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrutskikh committed Sep 23, 2021
1 parent dae6762 commit d852bb7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

* Fix unhandled exception while parsing `analysis_options.yaml`

## 4.3.2

* Restrict analyzer version to '>=2.1.0 <2.4.0'
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils/yaml_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ List<Object> yamlListToDartList(YamlList list) =>
Map<String, Object> yamlMapToDartMap(YamlMap map) =>
Map.unmodifiable(Map<String, Object>.fromEntries(map.nodes.keys
.whereType<YamlScalar>()
.where((key) => key.value is String)
.where((key) => key.value is String && map.nodes[key]?.value != null)
.map((key) => MapEntry(
key.value as String,
yamlNodeToDartObject(map.nodes[key]),
Expand Down
4 changes: 4 additions & 0 deletions test/resources/analysis_options_repo.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
include: ./analysis_options_common.yaml

linter:
# rules:
# avoid_print: true

analyzer:
plugins:
- code_checker
Expand Down

0 comments on commit d852bb7

Please sign in to comment.