!297 fix & improve

Merge pull request !297 from OceansDeep/pg
This commit is contained in:
OceansDeep 2023-07-19 03:11:19 +00:00 committed by Gitee
commit e945f93032
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -75,7 +75,7 @@ public class UploadController {
}
if (!CharSequenceUtil.containsAny(file.getContentType().toLowerCase(), "image")) {
if (!CharSequenceUtil.containsAny(Objects.requireNonNull(file.getContentType()).toLowerCase(), "image", "video")) {
throw new ServiceException(ResultCode.FILE_TYPE_NOT_SUPPORT);
}