Commit 3ccae49f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Lua: check vlclua_get_playlist_internal() for NULL

parent 78e0f035
......@@ -62,9 +62,16 @@ input_thread_t * vlclua_get_input_internal( lua_State *L )
return p_input;
}
}
playlist_t *p_playlist = vlclua_get_playlist_internal( L );
input_thread_t *p_input = playlist_CurrentInput( p_playlist );
return p_input;
if( p_playlist != NULL )
{
input_thread_t *p_input = playlist_CurrentInput( p_playlist );
if( p_input )
return p_input;
}
return NULL;
}
static int vlclua_input_item_info( lua_State *L )
......
......@@ -128,11 +128,16 @@ static int vlclua_get_vout( lua_State *L )
static int vlclua_get_aout( lua_State *L )
{
playlist_t *p_playlist = vlclua_get_playlist_internal( L );
audio_output_t *p_aout = playlist_GetAout( p_playlist );
if( p_aout != NULL )
vlclua_push_vlc_object( L, (vlc_object_t *)p_aout );
else
lua_pushnil( L );
if( p_playlist != NULL )
{
audio_output_t *p_aout = playlist_GetAout( p_playlist );
if( p_aout != NULL )
{
vlclua_push_vlc_object( L, (vlc_object_t *)p_aout );
return 1;
}
}
lua_pushnil( L );
return 1;
}
/*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment