SonarQube - Null Pointer Dereference Issue

Hello,

better way to handle this is to store the result of method invocation in a variable. There is no guarantee that subsequent invocations are returning the same value, that’s why issue is raised.

1 Like