Skip to content

Commit 100ffac

Browse files
Merge branch 'develop' of https://github.com/wordpress-mobile/AztecEditor-iOS into develop
2 parents cc2c34d + 0292487 commit 100ffac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Aztec/Classes/Extensions/String+EndOfLine.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ extension String {
2121
/// - Returns: `true` if the specified offset is in an empty paragraph, `false` otherwise.
2222
///
2323
func isEmptyParagraph(at offset: Int) -> Bool {
24-
25-
let index = self.index(startIndex, offsetBy: offset)
24+
guard let index = self.indexFromLocation(offset) else {
25+
return true
26+
}
2627

2728
return isEmptyParagraph(at: index)
2829
}

0 commit comments

Comments
 (0)