fix(compiler): handle undefined annotation metadata (#23349)
In certain cases seen in production, simplify() can returned undefined when simplifying decorator metadata. This has proven tricky to reproduce in an isolated test, but the fix is simple and low-risk: don't attempt to spread an undefined set of annotations in the first place. PR Close #23349
This commit is contained in:
parent
f2563ca800
commit
ca776c59dd
|
@ -163,7 +163,9 @@ export class StaticReflector implements CompileReflector {
|
||||||
let ownAnnotations: any[] = [];
|
let ownAnnotations: any[] = [];
|
||||||
if (classMetadata['decorators']) {
|
if (classMetadata['decorators']) {
|
||||||
ownAnnotations = simplify(type, classMetadata['decorators']);
|
ownAnnotations = simplify(type, classMetadata['decorators']);
|
||||||
annotations.push(...ownAnnotations);
|
if (ownAnnotations) {
|
||||||
|
annotations.push(...ownAnnotations);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (parentType && !this.summaryResolver.isLibraryFile(type.filePath) &&
|
if (parentType && !this.summaryResolver.isLibraryFile(type.filePath) &&
|
||||||
this.summaryResolver.isLibraryFile(parentType.filePath)) {
|
this.summaryResolver.isLibraryFile(parentType.filePath)) {
|
||||||
|
|
Loading…
Reference in New Issue