Skip to content

Commit c67964a

Browse files
committed
Fixed correctedContent method for nil string.
1 parent 6438084 commit c67964a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/TextFormatter/TextInputFormatters/TextInputFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private extension TextInputFormatter {
8181
- Returns: New String with replaced characters in range from old string
8282
*/
8383
func correctedContent(currentContent: String?, range: NSRange, replacementFiltered: String) -> String? {
84-
guard let oldText = currentContent else { return nil }
84+
let oldText = currentContent ?? String()
8585

8686
let correctedRange = unformattedRange(from: range)
8787
let oldUnformatted = unformattedText(from: oldText) as NSString?

0 commit comments

Comments
 (0)