Skip to content
Advertisement

Sonar Issue-Possible null pointer dereference due to return value of called method. Return value from a method is dereferenced without a null check

I have a void method which is being called with a string argument from a parent method.

JavaScript

Advertisement

Answer

JavaScript

getText seems to be more than a simple getter. The second time it evidently may return null.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement