diff --git a/cli/sdk/src/IntrospectionEngine.ts b/cli/sdk/src/IntrospectionEngine.ts index 3d20198b596c..74c2ea9ea337 100644 --- a/cli/sdk/src/IntrospectionEngine.ts +++ b/cli/sdk/src/IntrospectionEngine.ts @@ -365,6 +365,13 @@ export class IntrospectionEngine { } } }) + if (this.child!.stdin!.destroyed) { + throw new Error( + `Can't execute ${JSON.stringify( + request, + )} because introspection engine is destroyed.`, + ) + } debugRpc('SENDING RPC CALL', JSON.stringify(request)) this.child!.stdin!.write(JSON.stringify(request) + '\n') this.lastRequest = request