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

Commit d852bb7

Browse files
committed
fix: unhandled exception while parsing analysis_options.yaml
1 parent dae6762 commit d852bb7

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
* Fix unhandled exception while parsing `analysis_options.yaml`
6+
37
## 4.3.2
48

59
* Restrict analyzer version to '>=2.1.0 <2.4.0'

lib/src/utils/yaml_utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ List<Object> yamlListToDartList(YamlList list) =>
88
Map<String, Object> yamlMapToDartMap(YamlMap map) =>
99
Map.unmodifiable(Map<String, Object>.fromEntries(map.nodes.keys
1010
.whereType<YamlScalar>()
11-
.where((key) => key.value is String)
11+
.where((key) => key.value is String && map.nodes[key]?.value != null)
1212
.map((key) => MapEntry(
1313
key.value as String,
1414
yamlNodeToDartObject(map.nodes[key]),

test/resources/analysis_options_repo.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
include: ./analysis_options_common.yaml
22

3+
linter:
4+
# rules:
5+
# avoid_print: true
6+
37
analyzer:
48
plugins:
59
- code_checker

0 commit comments

Comments
 (0)