Question about the object toString reported null pointer in debug mode. Method threw 'java.lang.NullPointerException' exception. Can not evaluate cn.gooday.jsh.service.common.dto.RestControllerResult.toString ()

If this debug when you can go step by step or return to normal operation when there is the return value is correct. Description Code is no problem.

This occurs because there are some fields dto objects found out it is empty, or the field has always been a redundant field in dto years.

Because of the need to display variable information Debug mode, this information is to call the toString () method to get, so if toString () method in the operation of the null variable, there will be such an exception. However, this situation does not matter, because it is seen under Debug,
Normal execution down no problem do not have control.
 
Another is that the company may configure a swagger, your information to be a reference like this to one example, the problem does not occur. Empty string "", it does not announce null pointer exception. That + "."

 

 

Guess you like

Origin www.cnblogs.com/onlyzhangmeng/p/12310485.html