[fix] handle null value in date filter (#11655)

This commit is contained in:
Grace Guo
2020-11-11 09:32:26 -08:00
committed by GitHub
parent 77dff0e4e0
commit a9f9c4bbd5
2 changed files with 15 additions and 2 deletions

View File

@@ -236,11 +236,11 @@ class DateFilterControl extends React.Component {
};
const { value } = props;
if (value.indexOf(SEPARATOR) >= 0) {
if (value && value.indexOf(SEPARATOR) >= 0) {
this.state = { ...this.state, ...getStateFromSeparator(value) };
} else if (COMMON_TIME_FRAMES.indexOf(value) >= 0) {
this.state = { ...this.state, ...getStateFromCommonTimeFrame(value) };
} else {
} else if (value) {
this.state = { ...this.state, ...getStateFromCustomRange(value) };
}