Merge pull request #1294 from mfietz/issue/1293-NPE-MainActivity-onContextItemSelected
Prevent NPE in MainActivity.onContextItemSelected()
This commit is contained in:
commit
277cfa01d0
|
@ -551,8 +551,11 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity
|
||||||
menuInfo = lastMenuInfo;
|
menuInfo = lastMenuInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(menuInfo.targetView.getParent() instanceof ListView == false
|
if(menuInfo == null
|
||||||
|| ((ListView)menuInfo.targetView.getParent()).getId() != R.id.nav_list) {
|
|| menuInfo.targetView == null
|
||||||
|
|| menuInfo.targetView.getParent() == null
|
||||||
|
|| menuInfo.targetView.getParent() instanceof ListView == false
|
||||||
|
|| ((ListView)menuInfo.targetView.getParent()).getId() != R.id.nav_list) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final int position = menuInfo.position;
|
final int position = menuInfo.position;
|
||||||
|
|
Loading…
Reference in New Issue