Should you use a safe navigation operator ?. (in your example, which would be obj1?.obj2?.obj3 ) to avoid the unpleasant NullPointerException when navigating the beans graph.
A detailed explanation and some examples can be found in chapter 6.5.15. Safe navigation operator reference
source share