LPS-49395 continue when element has no attributes

The diffs may contain comments, for which `element.getAttributes()` will
return `null` instead of an empty attribute collection.