summaryrefslogtreecommitdiffstats
path: root/gui/checkbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--gui/checkbox.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/gui/checkbox.cpp b/gui/checkbox.cpp
index a2958db99..de63cba36 100644
--- a/gui/checkbox.cpp
+++ b/gui/checkbox.cpp
@@ -82,10 +82,11 @@ GUICheckbox::GUICheckbox(xml_node<>* node)
DataManager::SetValue(mVarName, attr->value());
}
- mCheckW = mChecked->GetWidth();
- mCheckH = mChecked->GetHeight();
- if (mCheckW == 0)
- {
+ mCheckW = mCheckH = 0;
+ if (mChecked && mChecked->GetResource()) {
+ mCheckW = mChecked->GetWidth();
+ mCheckH = mChecked->GetHeight();
+ } else if (mUnchecked && mUnchecked->GetResource()) {
mCheckW = mUnchecked->GetWidth();
mCheckH = mUnchecked->GetHeight();
}