Prevent null pointer dereference

This commit is contained in:
twinaphex 2016-06-30 16:10:09 +02:00
parent 9ee55cf7cc
commit 22ac73ba26

View File

@ -1714,6 +1714,9 @@ bool task_push_content_load_default(
{ {
bool loading_from_menu = false; bool loading_from_menu = false;
if (!content_info)
return false;
/* First we determine if we are loading from a menu */ /* First we determine if we are loading from a menu */
switch (mode) switch (mode)
{ {
@ -1749,7 +1752,7 @@ bool task_push_content_load_default(
case CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_COMPANION_UI: case CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_COMPANION_UI:
case CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE: case CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE:
#ifdef HAVE_MENU #ifdef HAVE_MENU
if (content_info && !content_info->environ_get) if (!content_info->environ_get)
content_info->environ_get = menu_content_environment_get; content_info->environ_get = menu_content_environment_get;
#endif #endif
break; break;