From 7393b73dca1f9880729bc5fdc571e28b9d75a8e7 Mon Sep 17 00:00:00 2001 From: pieh Date: Wed, 5 Sep 2012 22:04:19 +0200 Subject: possible NULL dereferences fixes crashes when showing epg for current channel when there is no current channel --- xbmc/pvr/windows/GUIWindowPVRGuide.cpp | 4 ++-- 1 file 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)); -- cgit v1.2.3