Skip to content

Commit

Permalink
Check if ctx is null and exit early.
Browse files Browse the repository at this point in the history
This would never happen.

Coverity #1046919
  • Loading branch information
jyavenard committed Jul 12, 2013
1 parent f74eca3 commit 37dde6f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -2171,6 +2171,9 @@ void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx)
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("HandleStateChange(%1) -- begin")
.arg(find_player_index(ctx)));

if (!ctx) // can never happen, but keep coverity happy
return;

if (ctx->IsErrored())
{
LOG(VB_GENERAL, LOG_ERR, LOC +
Expand Down Expand Up @@ -2408,7 +2411,7 @@ void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx)
{
SET_LAST();
SetErrored(ctx);
if (ctx && ctx->IsPlayerErrored())
if (ctx->IsPlayerErrored())
{
ShowNotificationError(ctx->player->GetError(),
_Location,
Expand Down

0 comments on commit 37dde6f

Please sign in to comment.