Skip to content

Commit

Permalink
Silence coverity warning about possible null pointer dereference (fal…
Browse files Browse the repository at this point in the history
…se positive). Coverity 746813
  • Loading branch information
stuartm committed Jun 3, 2013
1 parent a7c0e41 commit 7a5961f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mythtv/libs/libmythui/xmlparsebase.cpp
Expand Up @@ -517,7 +517,7 @@ MythUIType *XMLParseBase::ParseUIType(
return NULL;
}

if (olduitype)
if (olduitype && parent)
{
if (typeid(*olduitype) != typeid(*uitype))
{
Expand All @@ -540,7 +540,8 @@ MythUIType *XMLParseBase::ParseUIType(
VERBOSE_XML(VB_GENERAL, LOG_ERR, filename, element,
QString("Type of new widget '%1' doesn't match old '%2'")
.arg(name).arg(inherits));
parent->DeleteChild(uitype);
if (parent)
parent->DeleteChild(uitype);
return NULL;
}
else
Expand Down

0 comments on commit 7a5961f

Please sign in to comment.