Skip to content

Commit

Permalink
Use span length to determine true state of null
Browse files Browse the repository at this point in the history
  • Loading branch information
kekavc24 committed Jul 4, 2024
1 parent 7dd5eac commit 2555b32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/map_mutations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ SourceEdit _removeFromBlockMap(
/// Null values have an invalid offset. Include colon.
///
/// See issue open in `package: yaml`.
var endOffset = valueNode.value == null
var endOffset = valueNode.span.length == 0
? keySpan.end.offset + 2
: getContentSensitiveEnd(valueNode) + 1; // Overeager to avoid issues

Expand Down

0 comments on commit 2555b32

Please sign in to comment.