summaryrefslogtreecommitdiff
path: root/src/gui/theme.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/theme.cpp')
-rw-r--r--src/gui/theme.cpp15
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;