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
Looking at RadarView.java I see the code is attempting to iterate over worldListType using an int counter starting at zero, causing the NPE if there is no worldListType=0 defined. Safer to just use Java collection iterator (or for-each loop) here, the int counters are not required.
// in RadarView#drawRadarPoints(Canvas):for (inti = 0; i < mRadarPlugin.getWorld().getBeyondarObjectLists().size(); i++) {
BeyondarObjectListlist = mRadarPlugin.getWorld().getBeyondarObjectList(i);
for (intj = 0; j < list.size(); j++) { // line 69, NPE here when list == nullBeyondarObjectbeyondarObject = list.get(j);
RadarPointPluginradarPointPlugin = (RadarPointPlugin) beyondarObject
.getFirstPlugin(RadarPointPlugin.class);
Easily fixed (and more elegant) using Java for-each loop instead of dodgy int indexes like this:
// in RadarView#drawRadarPoints(Canvas):for (BeyondarObjectListlist : mRadarPlugin.getWorld().getBeyondarObjectLists()) {
for (BeyondarObjectbeyondarObject : list) {
RadarPointPluginradarPointPlugin = (RadarPointPlugin) beyondarObject
.getFirstPlugin(RadarPointPlugin.class);
The text was updated successfully, but these errors were encountered:
Looking at RadarView.java I see the code is attempting to iterate over worldListType using an int counter starting at zero, causing the NPE if there is no worldListType=0 defined. Safer to just use Java collection iterator (or for-each loop) here, the int counters are not required.
Easily fixed (and more elegant) using Java for-each loop instead of dodgy int indexes like this:
The text was updated successfully, but these errors were encountered: