Skip to content
Browse files

Merge pull request #1 from jbate/master

Check file is defined
  • Loading branch information...
2 parents cfb08eb + 2c703d4 commit 535bb7f265536befa0a11158a1a77b58a3d53421 @chriscoyier chriscoyier committed Jan 16, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 avatar.js
View
4 avatar.js
@@ -68,7 +68,7 @@ jQuery.event.props.push('dataTransfer');
// Multiple files can be dropped. Lets only deal with the "first" one.
var file = files[0];
- if (file.type.match('image.*')) {
+ if (typeof file !== 'undefined' && file.type.match('image.*')) {
Avatar.resizeImage(file, 256, function(data) {
Avatar.placeImage(data);
@@ -112,4 +112,4 @@ jQuery.event.props.push('dataTransfer');
Avatar.init();
-})();
+})();

0 comments on commit 535bb7f

Please sign in to comment.
Something went wrong with that request. Please try again.