diff options
author | Maayan Hanin <maayan.asa.hanin@gmail.com> | 2020-07-09 22:06:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-09 21:06:51 +0200 |
commit | edb7a0eead3604316b3cca2ac9122c5599445a63 (patch) | |
tree | e8d7fe06992decf52c81678b4c000a6edeb922fd /cli/worker.rs | |
parent | 202e7fa6ad366ee56a6d070e94eaecb6dbc745bf (diff) |
fix(cli): panic when stdio is null on windows (#6528)
Fixes: #6409
Diffstat (limited to 'cli/worker.rs')
-rw-r--r-- | cli/worker.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cli/worker.rs b/cli/worker.rs index 4ac1ee6a6..08367da91 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -300,9 +300,15 @@ impl MainWorker { let state_rc = CoreIsolate::state(&worker.isolate); let state = state_rc.borrow(); let mut t = state.resource_table.borrow_mut(); - t.add("stdin", Box::new(stdin)); - t.add("stdout", Box::new(stdout)); - t.add("stderr", Box::new(stderr)); + if let Some(stream) = stdin { + t.add("stdin", Box::new(stream)); + } + if let Some(stream) = stdout { + t.add("stdout", Box::new(stream)); + } + if let Some(stream) = stderr { + t.add("stderr", Box::new(stream)); + } } worker.execute("bootstrap.mainRuntime()")?; Ok(worker) |