diff --git a/packages/di/src/lib/metadata.ts b/packages/di/src/lib/metadata.ts index 68ea2cbf..6f11811b 100644 --- a/packages/di/src/lib/metadata.ts +++ b/packages/di/src/lib/metadata.ts @@ -18,9 +18,11 @@ export function readMetadata( return metadata; } -export function readInjector(target: T): Injector | null { - if (INJECTOR in target) { - return target[INJECTOR] as Injector; +export function readInjector(target: T): Injector | null { + if (typeof target === "object" && target !== null) { + if (INJECTOR in target) { + return target[INJECTOR] as Injector; + } } return null;