mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Fix crashes
This commit is contained in:
@@ -1025,7 +1025,14 @@ public class TextNode: ASDisplayNode {
|
||||
layoutSize.height += fontLineSpacing
|
||||
}
|
||||
|
||||
let lineRange = CFRangeMake(lastLineCharacterIndex, lineCharacterCount)
|
||||
var lineRange = CFRangeMake(lastLineCharacterIndex, lineCharacterCount)
|
||||
if lineRange.location + lineRange.length > attributedString.length {
|
||||
lineRange.length = attributedString.length - lineRange.location
|
||||
}
|
||||
if lineRange.length < 0 {
|
||||
break
|
||||
}
|
||||
|
||||
let coreTextLine = CTTypesetterCreateLineWithOffset(typesetter, lineRange, 100.0)
|
||||
lastLineCharacterIndex += lineCharacterCount
|
||||
|
||||
|
||||
Reference in New Issue
Block a user