Skip to content

Commit

Permalink
fix issue when looking up cached values for primative values
Browse files Browse the repository at this point in the history
  • Loading branch information
deebloo committed Jan 30, 2025
1 parent 0c32687 commit 28020ed
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/di/src/lib/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ export function readMetadata<T>(
return metadata;
}

export function readInjector<T extends object>(target: T): Injector | null {
if (INJECTOR in target) {
return target[INJECTOR] as Injector;
export function readInjector<T>(target: T): Injector | null {
if (typeof target === "object" && target !== null) {
if (INJECTOR in target) {
return target[INJECTOR] as Injector;
}
}

return null;
Expand Down

0 comments on commit 28020ed

Please sign in to comment.