diff --git a/src/Handler/Utils/Workflow/Form.hs b/src/Handler/Utils/Workflow/Form.hs index 8c9ce7acc..d5da60e2c 100644 --- a/src/Handler/Utils/Workflow/Form.hs +++ b/src/Handler/Utils/Workflow/Form.hs @@ -122,9 +122,7 @@ workflowGraphForm template = validateAForm validateWorkflowGraphForm . hoistAFor [fRef] -> return fRef _other -> throwE $ SomeMessage MsgWorkflowGraphFormInvalidNumberOfFiles mContent <- for (fileContent $ sourceFile fRef) $ \fContent -> lift . runDB . runConduit $ fContent .| C.fold - content <- case mContent of - Nothing -> throwE $ SomeMessage MsgWorkflowGraphFormUploadIsDirectory - Just c -> return c + content <- maybe (throwE $ SomeMessage MsgWorkflowGraphFormUploadIsDirectory) return mContent either (throwE . SomeMessage . MsgYAMLFieldDecodeFailure . displayException) return . runCatch $ Yaml.decodeThrow content fromGraph :: WorkflowGraph FileIdent CryptoUUIDUser -> FileUploads fromGraph g = yieldM . runDB $ do