fix sonar - pmd : AvoidThrowingNullPointerException