Skip to content

Commit

Permalink
impossible err check fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirari04 committed Apr 8, 2024
1 parent db2281d commit f263c2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/CreateFileController.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ func CreateFile(c echo.Context) error {

// business logic
status, dbLink, cloned, err := logic.CreateFile(&filePath, fileValidation.ParentFolderID, file.Filename, fileId, file.Size, c.Get("UserID").(uint))
if err != nil {
return c.String(status, err.Error())
}
if err != nil || cloned {
os.Remove(filePath)
}
if err != nil {
return c.String(status, err.Error())
}

return c.JSON(status, dbLink)
}

0 comments on commit f263c2a

Please sign in to comment.