SONARJAVA-494 Avoid throwing NPE