Skip to content

Commit

Permalink
CGUIControlSetting: add missing NULL-pointer checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Montellese committed May 7, 2014
1 parent 33f0092 commit ce0e7c3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions xbmc/settings/windows/GUIControlSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ CGUIControlRadioButtonSetting::CGUIControlRadioButtonSetting(CGUIRadioButtonCont
: CGUIControlBaseSetting(id, pSetting)
{
m_pRadioButton = pRadioButton;
if (m_pRadioButton == NULL)
return;

m_pRadioButton->SetID(id);
Update();
}
Expand All @@ -98,6 +101,9 @@ CGUIControlSpinExSetting::CGUIControlSpinExSetting(CGUISpinControlEx *pSpin, int
: CGUIControlBaseSetting(id, pSetting)
{
m_pSpin = pSpin;
if (m_pSpin == NULL)
return;

m_pSpin->SetID(id);

FillControl();
Expand Down Expand Up @@ -146,6 +152,9 @@ void CGUIControlSpinExSetting::Update()

void CGUIControlSpinExSetting::FillControl()
{
if (m_pSpin == NULL)
return;

m_pSpin->Clear();

const std::string &controlFormat = m_pSetting->GetControl()->GetFormat();
Expand Down Expand Up @@ -240,6 +249,9 @@ CGUIControlListSetting::CGUIControlListSetting(CGUIButtonControl *pButton, int i
: CGUIControlBaseSetting(id, pSetting)
{
m_pButton = pButton;
if (m_pButton == NULL)
return;

m_pButton->SetID(id);
Update();
}
Expand Down Expand Up @@ -484,6 +496,9 @@ CGUIControlButtonSetting::CGUIControlButtonSetting(CGUIButtonControl *pButton, i
: CGUIControlBaseSetting(id, pSetting)
{
m_pButton = pButton;
if (m_pButton == NULL)
return;

m_pButton->SetID(id);
Update();
}
Expand Down Expand Up @@ -582,6 +597,9 @@ CGUIControlEditSetting::CGUIControlEditSetting(CGUIEditControl *pEdit, int id, C
{
const CSettingControlEdit* control = static_cast<const CSettingControlEdit*>(pSetting->GetControl());
m_pEdit = pEdit;
if (m_pEdit == NULL)
return;

m_pEdit->SetID(id);
int heading = m_pSetting->GetLabel();
if (control->GetHeading() > 0)
Expand Down Expand Up @@ -655,6 +673,9 @@ CGUIControlSeparatorSetting::CGUIControlSeparatorSetting(CGUIImage *pImage, int
: CGUIControlBaseSetting(id, NULL)
{
m_pImage = pImage;
if (m_pImage == NULL)
return;

m_pImage->SetID(id);
}

Expand Down

0 comments on commit ce0e7c3

Please sign in to comment.