diff --git a/src/renderer/components/Experiment/Train/ViewOutputModal.tsx b/src/renderer/components/Experiment/Train/ViewOutputModal.tsx index b32eee6f97fcd6df1759be82c41fedbe82eaf12b..37d6fae9a029ee9073f87a463a9b73cd0b78fd6a 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