Skip to content

Commit 19536ed

Browse files
authored
fix: fix ormUtils prototype check crashing on null prototype (#9517)
1 parent 38e0eff commit 19536ed

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/util/OrmUtils.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,11 @@ export class OrmUtils {
390390
// At last checking prototypes as good as we can
391391
if (!(typeof x === "object" && typeof y === "object")) return false
392392

393-
if (x.isPrototypeOf(y) || y.isPrototypeOf(x)) return false
393+
if (
394+
Object.prototype.isPrototypeOf.call(x, y) ||
395+
Object.prototype.isPrototypeOf.call(y, x)
396+
)
397+
return false
394398

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

0 commit comments

Comments
 (0)