Menu

#12 BorderLayoutManager.removeWidget throws NPE

closed
Andy
None
0.9.6
5
2012-04-09
2003-02-20
g zombi
No

Because of a missing check for mSlots[i]!=null
removeWidget throws NPE, if mSlots[i] == null ...

this method should become:

public void removeWidget(Widget widget) {
mFather.removeWidget(widget);
for (int i = 0; i < mSlots.length; i++) {
if (mSlots[i]!=null) {
if (mSlots[i].mWidget == widget) {
mSlots[i] = null;
}
}
}
}

Discussion


Log in to post a comment.