Skip to content

Commit 9856270

Browse files
Merge pull request #494 from franciscofabian/develop
check array length before accessing array elements
2 parents 33a2395 + e7168ba commit 9856270

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const utils = {
120120
*/
121121
getVariableType(value, strictIntegers) {
122122
if (utils.isArray(value)) {
123-
if (value[0].nodeName === 'IMG') {
123+
if (value.length > 0 && value[0].nodeName === 'IMG') {
124124
return 'HTMLImageArray';
125125
}
126126
return 'Array';

0 commit comments

Comments
 (0)