From 5cfc1861d40a16052b2a768b653aa126d5096132 Mon Sep 17 00:00:00 2001 From: burnettk Date: Wed, 21 Feb 2024 17:29:12 -0500 Subject: [PATCH] handle no primary filename before attempting navigation --- spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx index 4c19fb389..b532468b3 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx @@ -201,6 +201,12 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { if (ability.can('GET', targetUris.processInstanceActionPath)) { const processResult = (result: ProcessModel) => { const primaryFileName = result.primary_file_name; + if (!primaryFileName) { + // this should be very unlikely, since we are in the context of an instance, + // but it's techically possible for the file to have been subsequently deleted or something. + console.error('Primary file name not found for the process model.'); + return; + } navigate( `/editor/process-models/${modifiedProcessModelId}/files/${primaryFileName}` );