diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b9808aa..364ba041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ * Produce a better error message for a nested property whose name starts with `--`. +* Fix a crash when a selector ends in an escaped backslash. + ## 1.57.1 * No user-visible changes. diff --git a/lib/src/utils.dart b/lib/src/utils.dart index 295f753d..21ae174a 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -114,7 +114,7 @@ int? _lastNonWhitespace(String string, {bool excludeEscape = false}) { if (!isWhitespace(codeUnit)) { if (excludeEscape && i != 0 && - i != string.length && + i != string.length - 1 && codeUnit == $backslash) { return i + 1; } else {