Minor: don't check the file name in an upload if there isn't one

This commit is contained in:
Mike Hearn 2016-03-08 17:26:46 +01:00
parent 29e58ce3db
commit 6ac05c2edb

View File

@ -45,7 +45,7 @@ class DataUploadServlet : HttpServlet() {
val messages = ArrayList<String>()
while (iterator.hasNext()) {
val item = iterator.next()
if (!acceptor.acceptableFileExtensions.any { item.name.endsWith(it) }) {
if (item.name != null && !acceptor.acceptableFileExtensions.any { item.name.endsWith(it) }) {
resp.sendError(HttpServletResponse.SC_BAD_REQUEST,
"${item.name}: Must be have a filename ending in one of: ${acceptor.acceptableFileExtensions}")
return