Skip to content

Commit

Permalink
#76 Cannot read property 'name' of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamednizar authored Aug 15, 2017
1 parent 14d8a68 commit b22ce03
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lf-ng-md-file-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
}
var boolValid = true;
modelValue.every(function(obj,idx){
if(obj.lfFile.type.match(reg)){
if(obj.lfFile !== undefined && obj.lfFile.type.match(reg)){
return true;
}else{
boolValid = false;
Expand Down Expand Up @@ -681,9 +681,12 @@

var isFileAreadyExist = false;

scope.lfFiles.every(function(obj,idx){
scope.lfFiles.every(function(obj,idx){
var lfFile = obj.lfFile;
if(lfFile.name == file.name) {
if(obj.isRemote) {
return true;
}
if(lfFile.name !== undefined && lfFile.name == file.name) {
if(lfFile.size == file.size) {
if(lfFile.lastModified == file.lastModified) {
isFileAreadyExist = true;
Expand Down

0 comments on commit b22ce03

Please sign in to comment.