Browse files

Update avatar.js

On the handleDrop function check to see whether "file" is defined
  • Loading branch information...
1 parent cfb08eb commit 2c703d477bf25ec54d8557590aced3b73dfa6e2b @jbate jbate 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 2c703d4

Please sign in to comment.