Skip to content

Commit e7168ba

Browse files
check array length before accessing array elements
1 parent 7589551 commit e7168ba

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)