fix null pointer dereferences

This commit is contained in:
Brad Parker 2018-08-18 01:07:51 -04:00
parent 2f87f669f1
commit 077ef86bab

View File

@ -1772,10 +1772,13 @@ void content_set_subsystem(unsigned idx)
pending_subsystem_id = idx;
strlcpy(pending_subsystem_ident,
subsystem->ident, sizeof(pending_subsystem_ident));
if (subsystem)
{
strlcpy(pending_subsystem_ident,
subsystem->ident, sizeof(pending_subsystem_ident));
pending_subsystem_rom_num = subsystem->num_roms;
pending_subsystem_rom_num = subsystem->num_roms;
}
RARCH_LOG("[subsystem] settings current subsytem to: %d(%s) roms: %d\n",
pending_subsystem_id, pending_subsystem_ident, pending_subsystem_rom_num);