diff --git a/Components/Sources/ComponentsObjC/WKSourceEditorFormatter.m b/Components/Sources/ComponentsObjC/WKSourceEditorFormatter.m index c110cccd765..f7351f00785 100644 --- a/Components/Sources/ComponentsObjC/WKSourceEditorFormatter.m +++ b/Components/Sources/ComponentsObjC/WKSourceEditorFormatter.m @@ -36,6 +36,10 @@ - (BOOL)canEvaluateAttributedString: (NSAttributedString *)attributedString agai return NO; } + if (attributedString.length <= range.location) { + return NO; + } + if (attributedString.length < (range.location + range.length)) { return NO; }