From c7be2b56274678e8e76f6cf7802b4f7ba58c605d Mon Sep 17 00:00:00 2001
From: ali asaria <aliasaria@users.noreply.github.com>
Date: Thu, 27 Jun 2024 15:10:53 -0400
Subject: [PATCH] fix but on missing output file

---
 .../components/Experiment/Train/ViewOutputModal.tsx    | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/renderer/components/Experiment/Train/ViewOutputModal.tsx b/src/renderer/components/Experiment/Train/ViewOutputModal.tsx
index b32eee6f..37d6fae9 100644
--- a/src/renderer/components/Experiment/Train/ViewOutputModal.tsx
+++ b/src/renderer/components/Experiment/Train/ViewOutputModal.tsx
@@ -16,6 +16,14 @@ export default function ViewOutputModal({ jobId, setJobId }) {
     }
   );
 
+  // The following code prevents a crash if the output file doesn't exist
+  var dataChecked = '';
+  if (data?.status) {
+    dataChecked = '';
+  } else {
+    dataChecked = data;
+  }
+
   return (
     <Modal open={jobId != -1} onClose={() => setJobId(-1)}>
       <ModalDialog>
@@ -37,7 +45,7 @@ export default function ViewOutputModal({ jobId, setJobId }) {
               cursorStyle: 'block',
               wordWrap: 'on',
             }}
-            value={data}
+            value={dataChecked}
           />
         </Typography>
         <Button
-- 
GitLab