Skip to content

Commit 5bdd6a0

Browse files
author
Mark Robinson
committed
Ensure path is present before download
1 parent 2fe3bf4 commit 5bdd6a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/commonwl/viewer/web/WorkflowController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ public FileSystemResource getFile(@PathVariable("workflowID") String workflowID,
147147
// Get workflow from database
148148
Workflow workflowModel = workflowRepository.findOne(workflowID);
149149

150-
// 404 error if workflow does not exist
151-
if (workflowModel == null) {
150+
// 404 error if workflow does not exist or the bundle doesn't yet
151+
if (workflowModel == null || workflowModel.getRoBundle() == null) {
152152
throw new WorkflowNotFoundException();
153153
}
154154

@@ -157,7 +157,7 @@ public FileSystemResource getFile(@PathVariable("workflowID") String workflowID,
157157

158158
// Serve the file from the local filesystem
159159
File bundleDownload = new File(workflowModel.getRoBundle());
160-
logger.info("Serving download for " + bundleDownload.toString());
160+
logger.info("Serving download for workflow " + workflowID + " [" + bundleDownload.toString() + "]");
161161
return new FileSystemResource(bundleDownload);
162162
}
163163
}

0 commit comments

Comments
 (0)