Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/ElZombieIsra/flutter-masked…
Browse files Browse the repository at this point in the history
…-text into 0.8.0

* 'master' of git://github.com/ElZombieIsra/flutter-masked-text:
  Fixed: updateText crashes when text is Null
  • Loading branch information
Ben-hur Santos Ott committed Feb 25, 2019
2 parents e7f061b + 7e1526e commit 4a0de95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/flutter_masked_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ class MaskedTextController extends TextEditingController {
String _lastUpdatedText = '';

void updateText(String text) {
this.text = this._applyMask(this.mask, text);
this._lastUpdatedText = this.text;
if(text != null){
this.text = this._applyMask(this.mask, text);
this._lastUpdatedText = this.text;
}
}

void updateMask(String mask, {bool moveCursorToEnd = true}) {
Expand Down

0 comments on commit 4a0de95

Please sign in to comment.