Skip to content

Commit

Permalink
fix: objectSupport plugin causes an error when null is passed to dayj…
Browse files Browse the repository at this point in the history
…s function (closes #2277) (#2342)
  • Loading branch information
titanism authored Jun 22, 2023
1 parent b3624de commit 89bf31c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin/objectSupport/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default (o, c, dayjs) => {
const proto = c.prototype
const isObject = obj => !(obj instanceof Date) && !(obj instanceof Array)
&& !proto.$utils().u(obj) && (obj.constructor.name === 'Object')
&& !proto.$utils().u(obj) && obj !== null && (obj.constructor.name === 'Object')
const prettyUnit = (u) => {
const unit = proto.$utils().p(u)
return unit === 'date' ? 'day' : unit
Expand Down

0 comments on commit 89bf31c

Please sign in to comment.