Skip to content

Commit

Permalink
Fix crash when typing in DateInput with only one input
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Jan 6, 2021
1 parent 329c7ba commit 70cfa40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DateInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ export default class DateInput extends PureComponent {
}

get divider() {
return this.placeholder.match(/[^0-9a-z]/i)[0];
const dividers = this.placeholder.match(/[^0-9a-z]/i);
return dividers ? dividers[0] : null;
}

get placeholder() {
Expand Down

0 comments on commit 70cfa40

Please sign in to comment.