Only create the directory structure if it is a file being renamed; closes pterodactyl/panel#2292
This commit is contained in:
@@ -149,6 +149,13 @@ func putServerRenameFiles(c *gin.Context) {
|
||||
}
|
||||
|
||||
if err := g.Wait(); err != nil {
|
||||
if errors.Is(err, os.ErrExist) {
|
||||
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{
|
||||
"error": "Cannot move or rename file, destination already exists.",
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
TrackedServerError(err, s).AbortWithServerError(c)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user