aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpieh <misiek.piechowiak@gmail.com>2012-09-05 22:04:19 +0200
committerpieh <misiek.piechowiak@gmail.com>2012-09-06 00:08:40 +0200
commit7393b73dca1f9880729bc5fdc571e28b9d75a8e7 (patch)
tree904e83daf80949a9ad287093def25c8c009cafec
parent9cf63fb84866cbc26adfb07ec32825e5acecbac5 (diff)
possible NULL dereferences
fixes crashes when showing epg for current channel when there is no current channel
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRGuide.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
index 5a58526cd6..fe165f4f1f 100644
--- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
@@ -142,10 +142,10 @@ void CGUIWindowPVRGuide::UpdateViewChannel(bool bUpdateSelectedFile)
m_parent->m_viewControl.SetCurrentView(CONTROL_LIST_GUIDE_CHANNEL);
m_parent->SetLabel(m_iControlButton, g_localizeStrings.Get(19222) + ": " + g_localizeStrings.Get(19029));
- if (bGotCurrentChannel)
+ if (bGotCurrentChannel && CurrentChannel.get())
m_parent->SetLabel(CONTROL_LABELGROUP, CurrentChannel->ChannelName().c_str());
- if (!bGotCurrentChannel || g_PVRManager.GetCurrentEpg(*m_parent->m_vecItems) == 0)
+ if ((!bGotCurrentChannel || g_PVRManager.GetCurrentEpg(*m_parent->m_vecItems) == 0) && CurrentChannel.get())
{
CFileItemPtr item;
item.reset(new CFileItem("pvr://guide/" + CurrentChannel->ChannelName() + "/empty.epg", false));