Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 5c139e5

Browse files
JiaLiPassionmhevery
authored andcommitted
fix(core): fix #1000, check target is null or not when patchOnProperty (#1004)
1 parent c7c7db5 commit 5c139e5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: lib/browser/property-descriptor.ts

+5
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ function filterProperties(
256256

257257
export function patchFilteredProperties(
258258
target: any, onProperties: string[], ignoreProperties: IgnoreProperty[], prototype?: any) {
259+
// check whether target is available, sometimes target will be undefined
260+
// because different browser or some 3rd party plugin.
261+
if (!target) {
262+
return;
263+
}
259264
const filteredProperties: string[] = filterProperties(target, onProperties, ignoreProperties);
260265
patchOnProperties(target, filteredProperties, prototype);
261266
}

0 commit comments

Comments
 (0)