Skip to content

Commit

Permalink
Merge pull request #707 from theo/lighthouse-1763-patch
Browse files Browse the repository at this point in the history
[#1763] Check for empty uploads when binding File[]
  • Loading branch information
pepite committed Jan 12, 2014
2 parents 2a282b1 + 5ab555a commit 9e64fb5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions framework/src/play/data/binding/types/FileArrayBinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ public File[] bind(String name, Annotation[] annotations, String value, Class ac
if (uploads != null) {
for (Upload upload : uploads) {
if (upload.getFieldName().equals(value)) {
File file = upload.asFile();
if (file.length() > 0) {
fileArray.add(file);
if(upload.getSize() != null && upload.getSize() > 0) {
File file = upload.asFile();
if (file.length() > 0) {
fileArray.add(file);
}
}
}
}
Expand Down

0 comments on commit 9e64fb5

Please sign in to comment.