CC-3324: Uncaught TypeError: Cannot read property 'length' of undefined - if watched dir not defined

This commit is contained in:
Martin Konecny 2012-02-13 12:24:55 -05:00
parent 3df396756f
commit 238abd6f87
1 changed files with 5 additions and 3 deletions

View File

@ -30,9 +30,11 @@ function generatePartitions(partitions){
var tr = $(row);
lastElement.after(tr);
var watched_dirs_ul = $('#watched-dir-list-'+i);
for (var j=0; j<partitions[i].dirs.length; j++){
watched_dirs_ul.append('<li>'+partitions[i].dirs[j]+'</li>');
if (partitions[i].dirs){
var watched_dirs_ul = $('#watched-dir-list-'+i);
for (var j=0; j<partitions[i].dirs.length; j++){
watched_dirs_ul.append('<li>'+partitions[i].dirs[j]+'</li>');
}
}
lastElement = tr;
}