-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Description
Describe the bug
dayjs(null) is throws error, 'Uncaught TypeError: can't access property "constructor", n is null'.
It says that error occured on dayjs/plugin/objectSupport.js
11:11:19.151 objectSupport.js:1 Uncaught TypeError: Cannot read properties of null (reading 'constructor')
at M.r (objectSupport.js:1:412)
at i.parse (objectSupport.js:1:887)
at e.parse (preParsePostFormat.js:1:447)
at u.parse (utc.js:1:692)
at new M (dayjs.min.js:1:2038)
at w (dayjs.min.js:1:1869)
at <anonymous>:1:1
r @ objectSupport.js:1
i.parse @ objectSupport.js:1
e.parse @ preParsePostFormat.js:1
u.parse @ utc.js:1
M @ dayjs.min.js:1
w @ dayjs.min.js:1
Expected behavior
It should be return dayjs object with invalid date. (it means, dayjs(null).isValid() return false correctly.)
Information
- Day.js Version: v1.11.6
- OS: Windows 10
- Browser: Firefox latest version
- Time zone: GMT+09:00
- Used Plugins:
- customParseFormat
- duration
- isoWeek
- isSameOrBefore
- objectSupport
smarlhens, knitevision1, bjorngi, LucaBernstein, illjah42 and 1 more