From 2b9afa106857ef6909af7e35c0a4fea0c4bd48f2 Mon Sep 17 00:00:00 2001 From: Percs <83934299+Percslol@users.noreply.github.com> Date: Sun, 27 Oct 2024 03:11:32 -0500 Subject: [PATCH] feat: add proxy and trapping checks --- src/client/client.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/client.ts b/src/client/client.ts index 3846d12..408d630 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -237,6 +237,7 @@ export class ScramjetClient { const split = name.split("."); const prop = split.pop(); const target = split.reduce((a, b) => a?.[b], this.global); + if (!target) return; const original = Reflect.get(target, prop); this.natives[name] = original; @@ -362,6 +363,7 @@ export class ScramjetClient { const split = name.split("."); const prop = split.pop(); const target = split.reduce((a, b) => a?.[b], this.global); + if (!target) return; const original = nativeGetOwnPropertyDescriptor(target, prop); this.descriptors[name] = original;