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