Merge pull request #1294 from mfietz/issue/1293-NPE-MainActivity-onContextItemSelected

Prevent NPE in MainActivity.onContextItemSelected()
This commit is contained in:
Tom Hennen 2015-10-29 17:41:19 -04:00
commit 277cfa01d0
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}