Skip to content

Commit

Permalink
Stop crashing on undefined or null properties
Browse files Browse the repository at this point in the history
Similar to other fix for flow intersection (#1806)
  • Loading branch information
nicholas-l committed Jun 28, 2018
1 parent 20779ff commit 71b522a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ module.exports = {
and property value. (key, value) => void
*/
function iterateProperties(properties, fn) {
if (properties.length && typeof fn === 'function') {
if (properties && properties.length && typeof fn === 'function') {
for (let i = 0, j = properties.length; i < j; i++) {
const node = properties[i];
const key = getKeyValue(node);
Expand Down

0 comments on commit 71b522a

Please sign in to comment.