From 830c9a54dc9f226f3478f0815b2e0a32fc5db95b Mon Sep 17 00:00:00 2001 From: ksooo <3226626+ksooo@users.noreply.github.com> Date: Wed, 14 Aug 2024 23:48:24 +0200 Subject: [PVR] Misc cppcheck warning fixes. --- xbmc/pvr/addons/PVRClients.cpp | 5 ----- xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp | 2 -- xbmc/pvr/dialogs/GUIDialogPVRGroupManager.cpp | 8 +++++++- xbmc/pvr/guilib/PVRGUIChannelNavigator.cpp | 3 +-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/xbmc/pvr/addons/PVRClients.cpp b/xbmc/pvr/addons/PVRClients.cpp index 9308a62a66..5863360f48 100644 --- a/xbmc/pvr/addons/PVRClients.cpp +++ b/xbmc/pvr/addons/PVRClients.cpp @@ -114,11 +114,6 @@ void CPVRClients::UpdateClients( else { client = std::make_shared(addon, instanceId, clientId); - if (!client) - { - CLog::LogF(LOGERROR, "Severe error, incorrect add-on type"); - continue; - } } // determine actual enabled state of instance diff --git a/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp b/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp index d785219a78..fccedb6c68 100644 --- a/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp +++ b/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp @@ -840,8 +840,6 @@ void CGUIDialogPVRChannelManager::Update() for (const auto& member : groupMembers) { channelFile = std::make_shared(member); - if (!channelFile) - continue; const std::shared_ptr channel(channelFile->GetPVRChannelInfoTag()); channelFile->SetProperty(PROPERTY_CHANNEL_ENABLED, !channel->IsHidden()); diff --git a/xbmc/pvr/dialogs/GUIDialogPVRGroupManager.cpp b/xbmc/pvr/dialogs/GUIDialogPVRGroupManager.cpp index 32bc313d67..be65ed1ef5 100644 --- a/xbmc/pvr/dialogs/GUIDialogPVRGroupManager.cpp +++ b/xbmc/pvr/dialogs/GUIDialogPVRGroupManager.cpp @@ -264,6 +264,9 @@ bool CGUIDialogPVRGroupManager::ActionButtonUngroupedChannels(const CGUIMessage& if (m_viewUngroupedChannels.HasControl(iControl)) // list/thumb control { + if (!m_selectedGroup) + return bReturn; + m_iSelectedUngroupedChannel = m_viewUngroupedChannels.GetSelectedItem(); if (m_selectedGroup->SupportsMemberAdd()) { @@ -304,6 +307,9 @@ bool CGUIDialogPVRGroupManager::ActionButtonGroupMembers(const CGUIMessage& mess if (m_viewGroupMembers.HasControl(iControl)) // list/thumb control { + if (!m_selectedGroup) + return bReturn; + m_iSelectedGroupMember = m_viewGroupMembers.GetSelectedItem(); if (m_selectedGroup->SupportsMemberRemove()) { @@ -311,7 +317,7 @@ bool CGUIDialogPVRGroupManager::ActionButtonGroupMembers(const CGUIMessage& mess if (actionID == ACTION_SELECT_ITEM || actionID == ACTION_MOUSE_LEFT_CLICK) { - if (m_selectedGroup && m_groupMembers->GetFileCount() > 0) + if (m_groupMembers->GetFileCount() > 0) { const auto itemChannel = m_groupMembers->Get(m_iSelectedGroupMember); ClearGroupThumbnails(*itemChannel); diff --git a/xbmc/pvr/guilib/PVRGUIChannelNavigator.cpp b/xbmc/pvr/guilib/PVRGUIChannelNavigator.cpp index cb3054371d..95ca4923e6 100644 --- a/xbmc/pvr/guilib/PVRGUIChannelNavigator.cpp +++ b/xbmc/pvr/guilib/PVRGUIChannelNavigator.cpp @@ -246,8 +246,7 @@ void CPVRGUIChannelNavigator::SwitchToCurrentChannel() item = std::make_unique(m_currentChannel); } - if (item) - CServiceBroker::GetPVRManager().Get().SwitchToChannel(*item, false); + CServiceBroker::GetPVRManager().Get().SwitchToChannel(*item, false); } bool CPVRGUIChannelNavigator::IsPreview() const -- cgit v1.2.3