From b4021b66fee03ab5ed64812e742807622a51a3fe Mon Sep 17 00:00:00 2001 From: David Hampton Date: Sat, 23 Mar 2019 10:42:03 -0400 Subject: [PATCH] tidy: Don't need to check pointer validity. The clang-tidy "clang-analyzer-core.CallAndMessage" check pointed out that it thought the m_frameTimer->stop function could be called when m_frameTimer was null. Looking at the code, m_frameTimer is created in the parent constructor, has the deleteLater function called on it in the parent destructor, and no other reference is protected by a nullptr check. It seems that the nullptr check is superfluous, not that the function can be called through a nullptr. --- mythplugins/mythzoneminder/mythzoneminder/zmplayer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mythplugins/mythzoneminder/mythzoneminder/zmplayer.cpp b/mythplugins/mythzoneminder/mythzoneminder/zmplayer.cpp index 200f8cc2f1f..17eadcbcf2b 100644 --- a/mythplugins/mythzoneminder/mythzoneminder/zmplayer.cpp +++ b/mythplugins/mythzoneminder/mythzoneminder/zmplayer.cpp @@ -126,8 +126,7 @@ bool ZMPlayer::Create(void) void ZMPlayer::getEventInfo() { - if (m_frameTimer) - m_frameTimer->stop(); + m_frameTimer->stop(); if (*m_currentEvent == -1) {