Commits

Sebastian Sdorra  committed 56b386d

fix search with repositories without description

  • Participants
  • Parent commits 644a968

Comments (0)

Files changed (1)

File scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.grid.js

         search = this.searchValue.toLowerCase();
       }
       store.filterBy(function(rec){
-        return (! search || 
-          rec.get('name').toLowerCase().indexOf(search) >= 0 || 
-          rec.get('description').toLowerCase().indexOf(search) >= 0) && 
-          (! this.typeFilter || rec.get('type') == this.typeFilter);
+        var desc = rec.get('description');
+        return (! search || rec.get('name').toLowerCase().indexOf(search) >= 0 ||
+               (desc && desc.toLowerCase().indexOf(search) >= 0)) && 
+               (! this.typeFilter || rec.get('type') == this.typeFilter);
       }, this);
     }
   },