From 8468f2fe97a71a9333e4004fc82fc49bf87339f7 Mon Sep 17 00:00:00 2001 From: Marc Laval Date: Tue, 4 Apr 2017 17:27:26 +0200 Subject: [PATCH] fix: make getter safe when patching a property --- lib/common/utils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/common/utils.ts b/lib/common/utils.ts index dc1c3e91a..0a7c898e2 100644 --- a/lib/common/utils.ts +++ b/lib/common/utils.ts @@ -106,6 +106,9 @@ export function patchProperty(obj: any, prop: string) { // The getter would return undefined for unassigned properties but the default value of an // unassigned property is null desc.get = function() { + if (this == null) { + return this; + } let r = this[_prop] || null; // result will be null when use inline event attribute, // such as