SONAR-2227 Fixed issue causing a stackoverflow