From 451bddf015a12e45de460677d8a8ce2b38dabd6c Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 18 Aug 2022 17:16:53 +0200 Subject: [PATCH] fix behavior of disable nsjail and disable nuser --- backend/src/worker.rs | 6 +++--- frontend/src/lib/components/FlowPreviewContent.svelte | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/backend/src/worker.rs b/backend/src/worker.rs index de4e728e7a..28f4f06116 100644 --- a/backend/src/worker.rs +++ b/backend/src/worker.rs @@ -698,7 +698,7 @@ print(res_json) tx.commit().await?; let mut reserved_variables = get_reserved_variables(job, token, db).await?; - if !disable_nuser { + if !disable_nsjail { let _ = write_file( job_dir, "run.config.proto", @@ -718,7 +718,7 @@ print(res_json) workspace_id = %job.workspace_id, "started python code execution" ); - let child = if !disable_nuser { + let child = if !disable_nsjail { Command::new(nsjail_path) .current_dir(job_dir) .env_clear() @@ -822,7 +822,7 @@ run(); let mut reserved_variables = get_reserved_variables(job, token, db).await?; reserved_variables.insert("RUST_LOG".to_string(), "info".to_string()); - if !disable_nuser { + if !disable_nsjail { let _ = write_file( job_dir, "run.config.proto", diff --git a/frontend/src/lib/components/FlowPreviewContent.svelte b/frontend/src/lib/components/FlowPreviewContent.svelte index b757ea0bbf..230d4582d2 100644 --- a/frontend/src/lib/components/FlowPreviewContent.svelte +++ b/frontend/src/lib/components/FlowPreviewContent.svelte @@ -41,9 +41,11 @@ x.forEach((y, j) => { if (`result` in y) { innerResults.push(y.result) - $flowStateStore[i].childFlowModules![j].previewResults = JSON.parse( - JSON.stringify(innerResults) - ) + if ($flowStateStore[i].childFlowModules![j] != undefined) { + $flowStateStore[i].childFlowModules![j].previewResults = JSON.parse( + JSON.stringify(innerResults) + ) + } } }) resultsSoFar.push(innerResults)