From 70cfa40ad909dc337edad3b11178ac23d50b5b71 Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Wed, 6 Jan 2021 22:23:40 +0100 Subject: [PATCH] Fix crash when typing in DateInput with only one input --- src/DateInput.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/DateInput.jsx b/src/DateInput.jsx index c3ff311f..90d55f2f 100644 --- a/src/DateInput.jsx +++ b/src/DateInput.jsx @@ -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() {