Prevent 'dereference before null check'

This commit is contained in:
twinaphex 2017-01-18 17:53:25 +01:00
parent b9104f38b8
commit aa47903520

View File

@ -69,6 +69,8 @@ void task_file_load_handler(retro_task_t *task)
{
nbio_handle_t *nbio = (nbio_handle_t*)task->state;
if (nbio)
{
switch (nbio->status)
{
case NBIO_STATUS_INIT:
@ -76,6 +78,7 @@ void task_file_load_handler(retro_task_t *task)
{
const char *fullpath = nbio->path;
struct nbio_t *handle = nbio_open(fullpath, NBIO_READ);
if (handle)
{
nbio->handle = handle;
@ -127,6 +130,7 @@ void task_file_load_handler(retro_task_t *task)
task_set_finished(task, true);
break;
}
}
if (task_get_cancelled(task))
{