From 2555b32d833bf0e668cf6a85dc8e21363683e83a Mon Sep 17 00:00:00 2001 From: Kelvin Kavisi <68240897+kekavc24@users.noreply.github.com> Date: Thu, 4 Jul 2024 17:57:56 +0100 Subject: [PATCH] Use span length to determine true state of `null` --- lib/src/map_mutations.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/map_mutations.dart b/lib/src/map_mutations.dart index 5fa0f17..2a2f906 100644 --- a/lib/src/map_mutations.dart +++ b/lib/src/map_mutations.dart @@ -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