Shouldn't we be checking `geometry.attributes` too, since there's no guarantee that it is set?