Skip to content

Commit 71b522a

Browse files
authored
Stop crashing on undefined or null properties
Similar to other fix for flow intersection (jsx-eslint#1806)
1 parent 20779ff commit 71b522a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rules/prop-types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ module.exports = {
360360
and property value. (key, value) => void
361361
*/
362362
function iterateProperties(properties, fn) {
363-
if (properties.length && typeof fn === 'function') {
363+
if (properties && properties.length && typeof fn === 'function') {
364364
for (let i = 0, j = properties.length; i < j; i++) {
365365
const node = properties[i];
366366
const key = getKeyValue(node);

0 commit comments

Comments
 (0)