diff --git a/plugins/techdocs-node/src/stages/generate/techdocs.ts b/plugins/techdocs-node/src/stages/generate/techdocs.ts index 252c3b2557..9bbc58ebdc 100644 --- a/plugins/techdocs-node/src/stages/generate/techdocs.ts +++ b/plugins/techdocs-node/src/stages/generate/techdocs.ts @@ -143,7 +143,12 @@ export class TechdocsGenerator implements GeneratorBase { ); break; case 'docker': - await this.containerRunner!.runContainer({ + if (this.containerRunner === undefined) { + throw new Error( + "Invalid state: containerRunner cannot be undefined when runIn is 'docker'", + ); + } + await this.containerRunner.runContainer({ imageName: this.options.dockerImage ?? TechdocsGenerator.defaultDockerImage, args: ['build', '-d', '/output'],