Skip to content

Commit

Permalink
fix(@ngtools/webpack): fix for #7615
Browse files Browse the repository at this point in the history
Check if this.done is defined before delaying file access
  • Loading branch information
rezonant authored and hansl committed Sep 13, 2017
1 parent 6c6584d commit cd404e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/@ngtools/webpack/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,9 @@ export class AotPlugin implements Tapable {
// Wait for the plugin to be done when requesting `.ts` files directly (entry points), or
// when the issuer is a `.ts` file.
compiler.resolvers.normal.plugin('before-resolve', (request: any, cb: () => void) => {
if (request.request.endsWith('.ts')
|| (request.context.issuer && request.context.issuer.endsWith('.ts'))) {
this.done!.then(() => cb(), () => cb());
if (this.done && (request.request.endsWith('.ts')
|| (request.context.issuer && request.context.issuer.endsWith('.ts')))) {
this.done.then(() => cb(), () => cb());
} else {
cb();
}
Expand Down

0 comments on commit cd404e2

Please sign in to comment.