Skip to content

Commit

Permalink
Fixed correctedContent method for nil string.
Browse files Browse the repository at this point in the history
  • Loading branch information
luximetr committed Nov 30, 2017
1 parent 6438084 commit c67964a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private extension TextInputFormatter {
- Returns: New String with replaced characters in range from old string
*/
func correctedContent(currentContent: String?, range: NSRange, replacementFiltered: String) -> String? {
guard let oldText = currentContent else { return nil }
let oldText = currentContent ?? String()

let correctedRange = unformattedRange(from: range)
let oldUnformatted = unformattedText(from: oldText) as NSString?
Expand Down

0 comments on commit c67964a

Please sign in to comment.