From 7a5961f2b1daa48229d3d5a1a2bc52e53d1b934e Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Mon, 3 Jun 2013 22:13:05 +0100 Subject: [PATCH] Silence coverity warning about possible null pointer dereference (false positive). Coverity 746813 --- mythtv/libs/libmythui/xmlparsebase.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mythtv/libs/libmythui/xmlparsebase.cpp b/mythtv/libs/libmythui/xmlparsebase.cpp index 632211142c1..dd3b18f4957 100644 --- a/mythtv/libs/libmythui/xmlparsebase.cpp +++ b/mythtv/libs/libmythui/xmlparsebase.cpp @@ -517,7 +517,7 @@ MythUIType *XMLParseBase::ParseUIType( return NULL; } - if (olduitype) + if (olduitype && parent) { if (typeid(*olduitype) != typeid(*uitype)) { @@ -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