Merge pull request #437 from gregh3269/struts-2-5-x

Empty file upload, storeLocation null gives wrong error message.
This commit is contained in:
Lukasz Lenart
2020-09-09 12:57:59 +02:00
committed by GitHub
@@ -343,6 +343,14 @@ public class FileUploadInterceptor extends AbstractInterceptor {
validation.addFieldError(inputName, errMsg);
}
if (LOG.isWarnEnabled()) {
LOG.warn(errMsg);
}
} else if (file.getContent() == null) {
String errMsg = getTextMessage(action, "struts.messages.error.uploading", new String[]{filename});
if (validation != null) {
validation.addFieldError(inputName, errMsg);
}
if (LOG.isWarnEnabled()) {
LOG.warn(errMsg);
}