From 89bf31ce0a36dcfc892029dc019d85d3654cf5fb Mon Sep 17 00:00:00 2001 From: titanism <101466223+titanism@users.noreply.github.com> Date: Thu, 22 Jun 2023 03:56:09 -0500 Subject: [PATCH] fix: objectSupport plugin causes an error when null is passed to dayjs function (closes #2277) (#2342) --- src/plugin/objectSupport/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin/objectSupport/index.js b/src/plugin/objectSupport/index.js index 650166606..4800b6873 100644 --- a/src/plugin/objectSupport/index.js +++ b/src/plugin/objectSupport/index.js @@ -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