Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

Commit

Permalink
fix(@ngtools/webpack): add check for request parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
sumbad authored and hansl committed May 10, 2018
1 parent 959826b commit 8c47c37
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/ngtools/webpack/src/angular_compiler_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,9 @@ export class AngularCompilerPlugin {
// Wait for the plugin to be done when requesting `.ts` files directly (entry points), or
// when the issuer is a `.ts` or `.ngfactory.js` file.
nmf.hooks.beforeResolve.tapAsync('angular-compiler', (request: any, callback: any) => {
if (this.done && (request.request.endsWith('.ts')
|| (request.context.issuer && /\.ts|ngfactory\.js$/.test(request.context.issuer)))) {
if (this.done && (request && request.request.endsWith('.ts')
|| (request && request.context.issuer
&& /\.ts|ngfactory\.js$/.test(request.context.issuer)))) {
this.done.then(() => callback(null, request), () => callback(null, request));
} else {
callback(null, request);
Expand Down

0 comments on commit 8c47c37

Please sign in to comment.