diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-08-28 15:18:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-08-29 00:18:56 +0300 |
commit | afbf2f713dd918bd0ff050d71afbf05bc581ab6e (patch) | |
tree | 6a06804aa813ed184b1293ab458929d372285385 /src/gui/theme.cpp | |
parent | 482cbfc4e1299434a6f632fe7f4b4e3704e65e87 (diff) | |
download | manaverse-afbf2f713dd918bd0ff050d71afbf05bc581ab6e.tar.gz manaverse-afbf2f713dd918bd0ff050d71afbf05bc581ab6e.tar.bz2 manaverse-afbf2f713dd918bd0ff050d71afbf05bc581ab6e.tar.xz manaverse-afbf2f713dd918bd0ff050d71afbf05bc581ab6e.zip |
fix some missing checks.
Diffstat (limited to 'src/gui/theme.cpp')
-rw-r--r-- | src/gui/theme.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index 97afec6d3..6d052b2b8 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -89,7 +89,7 @@ Skin::~Skin() { for (int i = 0; i < 9; i++) { - if (mBorder->grid[i]) + if (mBorder && mBorder->grid[i]) { mBorder->grid[i]->decRef(); mBorder->grid[i] = nullptr; @@ -132,10 +132,13 @@ void Skin::updateAlpha(const float minimumOpacityAllowed) std::max(static_cast<double>(minimumOpacityAllowed), static_cast<double>(client->getGuiAlpha()))); - for (int i = 0; i < 9; i++) + if (mBorder) { - if (mBorder->grid[i]) - mBorder->grid[i]->setAlpha(alpha); + for (int i = 0; i < 9; i++) + { + if (mBorder->grid[i]) + mBorder->grid[i]->setAlpha(alpha); + } } if (mCloseImage) @@ -150,7 +153,7 @@ void Skin::updateAlpha(const float minimumOpacityAllowed) int Skin::getMinWidth() const { - if (!mBorder->grid[ImageRect::UPPER_LEFT] + if (!mBorder || !mBorder->grid[ImageRect::UPPER_LEFT] || !mBorder->grid[ImageRect::UPPER_RIGHT]) { return 1; @@ -162,7 +165,7 @@ int Skin::getMinWidth() const int Skin::getMinHeight() const { - if (!mBorder->grid[ImageRect::UPPER_LEFT] + if (!mBorder || !mBorder->grid[ImageRect::UPPER_LEFT] || !mBorder->grid[ImageRect::LOWER_LEFT]) { return 1; |