aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <3226626+ksooo@users.noreply.github.com>2024-08-17 12:43:42 +0200
committerGitHub <noreply@github.com>2024-08-17 12:43:42 +0200
commitee85eff1898444a38ebf43eccc86ebfefba65965 (patch)
tree51676560ea311c9e3bc5a8ff5f30b92893125bf5
parentba574de51094e8097ecf199829e8a2085a83162a (diff)
parent830c9a54dc9f226f3478f0815b2e0a32fc5db95b (diff)
Merge pull request #25626 from ksooo/pvr-cppcheck-fixes
[PVR] Misc cppcheck warning fixes.
-rw-r--r--xbmc/pvr/addons/PVRClients.cpp5
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp2
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRGroupManager.cpp8
-rw-r--r--xbmc/pvr/guilib/PVRGUIChannelNavigator.cpp3
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<CPVRClient>(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<CFileItem>(member);
- if (!channelFile)
- continue;
const std::shared_ptr<const CPVRChannel> 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<CFileItem>(m_currentChannel);
}
- if (item)
- CServiceBroker::GetPVRManager().Get<PVR::GUI::Playback>().SwitchToChannel(*item, false);
+ CServiceBroker::GetPVRManager().Get<PVR::GUI::Playback>().SwitchToChannel(*item, false);
}
bool CPVRGUIChannelNavigator::IsPreview() const