diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b9808aae..364ba041d 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 295f753db..21ae174a5 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 {