Skip to content

Commit b2fdc83

Browse files
committed
Fixed crash when inserting text and multiple images.
1 parent faebe27 commit b2fdc83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Views/InputTextView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ open class InputTextView: UITextView {
347347
attachments.forEach { (attachment) in
348348
let (range, image) = attachment
349349
if curLocation < range.location {
350-
let textRange = NSMakeRange(curLocation, range.location)
350+
let textRange = NSMakeRange(curLocation, range.location-curLocation)
351351
let text = attributedText.attributedSubstring(from: textRange).string.trimmingCharacters(in: .whitespacesAndNewlines)
352352
if !text.isEmpty {
353353
components.append(text)

0 commit comments

Comments
 (0)