Various Fixes

This commit is contained in:
Ilya Laktyushin
2022-01-10 23:29:14 +03:00
parent 69b36c21f6
commit 9c42eebbbd
12 changed files with 56 additions and 21 deletions

View File

@@ -69,7 +69,9 @@ public func stringWithAppliedEntities(_ text: String, entities: [MessageTextEnti
if nsString == nil {
nsString = text as NSString
}
if range.location + range.length > stringLength {
if range.location > stringLength {
continue
} else if range.location + range.length > stringLength {
range.location = max(0, stringLength - range.length)
range.length = stringLength - range.location
}