Skip to content

Commit fe98434

Browse files
committed
utils: bugfix empty array for date
1 parent 726e6bd commit fe98434

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/utils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,12 @@ export function unifyDate(date) {
912912
}
913913

914914
if (Array.isArray(date)) {
915-
date = date[0];
915+
if (date.length) {
916+
date = date[0];
917+
} else {
918+
// Empty array.
919+
return null;
920+
}
916921
}
917922

918923
if (typeof date === "string" && date.match(/^\d+$/)) {

0 commit comments

Comments
 (0)