diff --git a/backend/app/service/file.go b/backend/app/service/file.go index 256f3a3c1..44a872107 100644 --- a/backend/app/service/file.go +++ b/backend/app/service/file.go @@ -231,6 +231,9 @@ func (f *FileService) GetContent(op request.FileContentReq) (response.FileInfo, Path: op.Path, Expand: true, }) + if err != nil { + return response.FileInfo{}, err + } content := []byte(info.Content) var decodeName string @@ -248,9 +251,6 @@ func (f *FileService) GetContent(op request.FileContentReq) (response.FileInfo, } info.Content = string(contents) } - if err != nil { - return response.FileInfo{}, err - } return response.FileInfo{FileInfo: *info}, nil }