Skip to content

Commit

Permalink
Prevent segfaults in mythuicheckbox if the theme xml is missing requi…
Browse files Browse the repository at this point in the history
…red components.
  • Loading branch information
stuartm committed Mar 8, 2012
1 parent e78a9ff commit 5ddc5aa
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions mythtv/libs/libmythui/mythuicheckbox.cpp
Expand Up @@ -73,7 +73,8 @@ void MythUICheckBox::toggleCheckState()
void MythUICheckBox::SetCheckState(MythUIStateType::StateType state)
{
m_currentCheckState = state;
m_CheckState->DisplayState(state);
if (m_CheckState)
m_CheckState->DisplayState(state);

if (state == MythUIStateType::Off)
emit DependChanged(true);
Expand Down Expand Up @@ -117,7 +118,8 @@ void MythUICheckBox::Select()
return;

m_state = "selected";
m_BackgroundState->DisplayState(m_state);
if (m_BackgroundState)
m_BackgroundState->DisplayState(m_state);
}

void MythUICheckBox::Deselect()
Expand All @@ -127,19 +129,22 @@ void MythUICheckBox::Deselect()
else
m_state = "disabled";

m_BackgroundState->DisplayState(m_state);
if (m_BackgroundState)
m_BackgroundState->DisplayState(m_state);
}

void MythUICheckBox::Enable()
{
m_state = "active";
m_BackgroundState->DisplayState(m_state);
if (m_BackgroundState)
m_BackgroundState->DisplayState(m_state);
}

void MythUICheckBox::Disable()
{
m_state = "disabled";
m_BackgroundState->DisplayState(m_state);
if (m_BackgroundState)
m_BackgroundState->DisplayState(m_state);
}

/** \brief Mouse click/movement handler, receives mouse gesture events from the
Expand Down

0 comments on commit 5ddc5aa

Please sign in to comment.