Skip to content

Commit

Permalink
Fix runtime error when this.tel is null
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienharnay authored Mar 18, 2018
1 parent 7cee4a3 commit e021526
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/IntlTelInputApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class IntlTelInputApp extends Component {
}
}

if (this.state.showDropdown) {
if (this.tel && this.state.showDropdown) {
this.tel.focus();
}

Expand Down Expand Up @@ -555,7 +555,7 @@ class IntlTelInputApp extends Component {
}

cap(number) {
const max = this.tel.getAttribute('maxlength');
const max = this.tel ? this.tel.getAttribute('maxlength') : number;

return max && number.length > max ? number.substr(0, max) : number;
}
Expand Down

0 comments on commit e021526

Please sign in to comment.