SONARJAVA-750 Fix S1170 when iterating over null children