You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In MapsActivity.drawHighway for example, we use for loops to run through the list, and assume that the list will contain elements!
This is only one example, the entire application should be checked for for loops like this which have the possibility of causing a NullPointerException!
This can cause the application to crash. A better use would be to use list iterators and account for the possibility that the list is empty.
Steps to reproduce:
Edit APIEntity.getNestedEntityUrlComponent(), change the URL. (Add an extra s before "s/")
(This will force calls to highways/x/stations to fail.)
Observe in the log output that the application will handle the failures, but that this causes the list of highways to be empty.
Observe that the application crashes with a NullPointerException, caused by the for loop assuming that the list is non-empty.
The text was updated successfully, but these errors were encountered:
In MapsActivity.drawHighway for example, we use for loops to run through the list, and assume that the list will contain elements!
This is only one example, the entire application should be checked for for loops like this which have the possibility of causing a NullPointerException!
This can cause the application to crash. A better use would be to use list iterators and account for the possibility that the list is empty.
Steps to reproduce:
(This will force calls to highways/x/stations to fail.)
The text was updated successfully, but these errors were encountered: