There are many customers today that reflect ourAPPthe one that opens up crashes because it's the home page that I do and I open it right nowapp Look,sure enough. My colleague.DebugThe code, the original homepage of theBannerpicture return isNULL, which is returned from the service side, which we have no control over. But is our client not responsible? We do the client does not guarantee that the server must have returned to US data, in some cases may beNULL. That's exactly what happened today. Look at my code, I added a layer of judgment on the home page returnedModelthe object of the class is not empty, but is not judgedBannerreturns whether the picture information is empty. If it's empty, I'll assign it to theViewpager, certainly forCrashthe. Then I added a layer of judgment whether it was empty. Even if no picture is returned, the app won't crash. Which information to use, it is necessary to determine whether it is empty. The return of the data returned by the server can be null, but we cannot let the appCrash, the information does not show no relationship, but try not to let the app haveCrash, which not only has a poor user experience, but also shows that the programmer's code is not robust enough. I will try to write strong code in the future, this habit is very important to a programmer.
About the robustness of code