diff --git a/lodash.js b/lodash.js index ee8ecf89f..cb30dd3ed 100644 --- a/lodash.js +++ b/lodash.js @@ -2849,7 +2849,7 @@ } } // add array properties assigned by `RegExp#exec` - if (typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { result.index = array.index; result.input = array.input; }