Skip to content

Commit

Permalink
fix: fix ormUtils prototype check crashing on null prototype (#9517)
Browse files Browse the repository at this point in the history
  • Loading branch information
nekomi2 committed Nov 5, 2022
1 parent 38e0eff commit 19536ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/util/OrmUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,11 @@ export class OrmUtils {
// At last checking prototypes as good as we can
if (!(typeof x === "object" && typeof y === "object")) return false

if (x.isPrototypeOf(y) || y.isPrototypeOf(x)) return false
if (
Object.prototype.isPrototypeOf.call(x, y) ||
Object.prototype.isPrototypeOf.call(y, x)
)
return false

if (x.constructor !== y.constructor) return false

Expand Down

0 comments on commit 19536ed

Please sign in to comment.