summaryrefslogtreecommitdiff
path: root/src/gui/widgets/icon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/icon.cpp')
-rw-r--r--src/gui/widgets/icon.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/widgets/icon.cpp b/src/gui/widgets/icon.cpp
index ef22c37d..4e590212 100644
--- a/src/gui/widgets/icon.cpp
+++ b/src/gui/widgets/icon.cpp
@@ -30,20 +30,22 @@ Icon::Icon(const std::string &file)
: mImage(0)
{
mImage = ResourceManager::getInstance()->getImage(file);
- setSize(mImage->getWidth(), mImage->getHeight());
-
+ if (mImage)
+ setSize(mImage->getWidth(), mImage->getHeight());
}
Icon::Icon(Image *image)
: mImage(image)
{
- setSize(mImage->getWidth(), mImage->getHeight());
+ if (mImage)
+ setSize(mImage->getWidth(), mImage->getHeight());
}
void Icon::setImage(Image *image)
{
mImage = image;
- setSize(mImage->getWidth(), mImage->getHeight());
+ if (mImage)
+ setSize(mImage->getWidth(), mImage->getHeight());
}
void Icon::draw(gcn::Graphics *g)