diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 94841c615a..688d72123a 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -69,8 +69,9 @@ export function createImportRefsToModelReducer(params: ModelGeneratorParams) { _interface.properties.forEach(prop => { prop.refs.forEach(ref => { - if (parseNamespace(solution, ref) !== model.namespace) - toBeImported.push({ type: ref, isEnum: types[ref]?.isEnum }); + const propType = types[ref]; + if (propType && parseNamespace(solution, ref) !== model.namespace) + toBeImported.push({ type: ref, isEnum: propType?.isEnum }); }); }); });