SONARJAVA-496 : Short circuit logic should be correct to avoid null dereferences