Skip to content

Commit 4340998

Browse files
Chau TranChau Tran
authored andcommitted
fix(core): check for length of args in NgtArgs before renderering
1 parent 1339651 commit 4340998

File tree

1 file changed

+2
-1
lines changed
  • libs/angular-three/src/lib/directives

1 file changed

+2
-1
lines changed

libs/angular-three/src/lib/directives/args.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export class NgtArgs<TArgs extends any[] = any[]> extends NgtCommonDirective {
66
#injectedArgs: TArgs = [] as unknown as TArgs;
77

88
@Input() set args(args: TArgs | null) {
9-
if (args == null || !Array.isArray(args) || (args.length === 1 && args[0] === null)) return;
9+
if (args == null || !Array.isArray(args) || args.length === 0 || (args.length === 1 && args[0] === null))
10+
return;
1011
this.injected = false;
1112
this.#injectedArgs = args;
1213
this.createView();

0 commit comments

Comments
 (0)