Skip to content

Commit 3678cd0

Browse files
committed
/series/add: fix validation of file type.
Correction for a123bb9 commit. Fix #202
1 parent 9eac39e commit 3678cd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/ru/mystamps/web/validation/jsr303/ImageFileValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public boolean isValid(MultipartFile file, ConstraintValidatorContext ctx) {
101101
try (InputStream stream = file.getInputStream()) {
102102

103103
byte[] firstPart = readFourBytes(stream);
104-
if (firstPart != null) {
104+
if (firstPart == null) {
105105
LOG.warn("Failed to read 4 bytes from file");
106106
return false;
107107
}

0 commit comments

Comments
 (0)