fix: 解决打开非文本文件报错的问题 (#5203)

pull/5205/head
zhengkunwang 2024-05-29 18:43:13 +08:00 committed by GitHub
parent 9f3573bcb8
commit 86d021cbfc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -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
}