Commit 3f659b04 authored by Romain Vimont's avatar Romain Vimont Committed by Jean-Baptiste Kempf

qt: fix nullptr dereference

Do not dereference new_media when it is NULL.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 887ad0be
......@@ -196,6 +196,11 @@ static void on_player_current_media_changed(vlc_player_t *, input_item_t *new_m
{
PlayerControllerPrivate* that = static_cast<PlayerControllerPrivate*>(data);
msg_Dbg( that->p_intf, "on_player_current_media_changed");
if (!new_media)
emit that->q_func()->inputChanged(false);
return;
InputItemPtr newMediaPtr = InputItemPtr( new_media );
that->callAsync([that,newMediaPtr] () {
PlayerController* q = that->q_func();
......@@ -205,7 +210,7 @@ static void on_player_current_media_changed(vlc_player_t *, input_item_t *new_m
RecentsMRL::getInstance( that->p_intf )->addRecent( newMediaPtr.get()->psz_uri );
emit q->inputChanged( newMediaPtr != nullptr );
emit q->inputChanged(true);
});
}
......
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