Skip to content

Check if node has attributes before iterating#529

Merged
mjangda merged 1 commit into
masterfrom
fix/node-foreach
Oct 11, 2016
Merged

Check if node has attributes before iterating#529
mjangda merged 1 commit into
masterfrom
fix/node-foreach

Conversation

@mjangda

@mjangda mjangda commented Oct 11, 2016

Copy link
Copy Markdown
Contributor

If the node has no attributes, ->attributes is null which results in errors when we try to loop through.

Warning: Invalid argument supplied for foreach() in /wp-content/plugins/amp/includes/utils/class-amp-dom-utils.php on line 48

h/t stephenmax

If the node has no attributes, `->attributes` is null which results in
errors when we try to loop through.

h/t stephenmax
@mjangda mjangda merged commit bd42867 into master Oct 11, 2016
@mjangda mjangda deleted the fix/node-foreach branch October 11, 2016 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant