Fix NPE introduced by erroneous Sonar issue fix