Skip to content

Commit

Permalink
find returns null
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislas Polu committed Nov 27, 2012
1 parent fc4a4ea commit 5e8df88
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 6 additions & 2 deletions cell-0.3.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/cell.js
Expand Up @@ -157,8 +157,12 @@ CELL.cell = function(spec, my) {
var comps = path.split('/');
var next = comps.shift();

if(next.length > 0)
return my.children[next].find(comps.join('/'));
if(next.length > 0) {
if(my.children[next])
return my.children[next].find(comps.join('/'));
else
return null;
}
else
return that;
};
Expand Down
8 changes: 6 additions & 2 deletions src/container.js
Expand Up @@ -92,8 +92,12 @@ CELL.container = function(spec, my) {
var comps = path.split('/');
var next = comps.shift();

if(next.length > 0)
return my.children[next].find(comps.join('/'));
if(next.length > 0) {
if(my.children[next])
return my.children[next].find(comps.join('/'));
else
return null;
}
else
return that;
};
Expand Down

0 comments on commit 5e8df88

Please sign in to comment.