Permalink
Browse files

If the form was sent without multipart-binary, there will be no :size…

… key. Handle this gracefully and invalidate the field without throwing an exception.
  • Loading branch information...
1 parent eb36d99 commit a21040c08cb882a8cf4245950dd04a4daed8ad3e @kenrestivo kenrestivo committed May 29, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/noir/validation.clj
View
@@ -43,7 +43,8 @@
(defn valid-file?
"Returns true if a valid file was supplied"
[m]
- (and (> (:size m) 0)
+ (and (:size m)
+ (> (:size m) 0)
(:filename m)))

0 comments on commit a21040c

Please sign in to comment.