Permalink
Browse files

Update imagemagick.js

While loop should check list length, otherwise you get an undefined. Return prop instead of props[0]
  • Loading branch information...
1 parent 158a638 commit 1e53278a4e2f02b9a08eda4c3cc52c53883ee9a5 @seanmcgary seanmcgary committed Sep 1, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 imagemagick.js
View
4 imagemagick.js
@@ -113,7 +113,7 @@ function parseIdentify(input) {
indent = currentLine.search(/\S/);
comps = currentLine.split(': ');
if (indent > prevIndent) indents.push(indent);
- while (indent < prevIndent) {
+ while (indent < prevIndent && props.length) {
indents.pop();
prop = props.pop();
prevIndent = indents[indents.length - 1];
@@ -127,7 +127,7 @@ function parseIdentify(input) {
prevIndent = indent;
}
}
- return props[0];
+ return prop;
};
exports.identify = function(pathOrArgs, callback) {

0 comments on commit 1e53278

Please sign in to comment.