Permalink
Browse files

[fix] Don't die if the structure is undefined

  • Loading branch information...
1 parent e6eec67 commit 3c071f5a4293e3809105ad020a62fc4780057cd6 @3rd-Eden 3rd-Eden committed Aug 21, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/plates.js
View
@@ -54,7 +54,7 @@ var Plates = (typeof module !== 'undefined' && typeof module.exports !== 'undefi
var result = key
, structure = data;
- for (var paths = key.split('.'), i = 0, length = paths.length; i < length; i++) {
+ for (var paths = key.split('.'), i = 0, length = paths.length; i < length && structure; i++) {
result = structure[+paths[i] || paths[i]];
structure = result;
}

0 comments on commit 3c071f5

Please sign in to comment.