From 5184d99bdc319271ee35046640478ab76d3754cc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 25 Oct 2013 13:45:49 +0300 Subject: add missing checks. --- src/text.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/text.cpp') diff --git a/src/text.cpp b/src/text.cpp index 887c66407..ee9e3b33a 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -46,8 +46,8 @@ Text::Text(const std::string &text, const int x, const int y, mFont(font ? font : (gui ? gui->getFont() : nullptr)), mX(x), mY(y), - mWidth(mFont->getWidth(text)), - mHeight(mFont->getHeight()), + mWidth(mFont ? mFont->getWidth(text) : 1), + mHeight(mFont ? mFont->getHeight() : 1), mXOffset(0), mText(text), mColor(color), -- cgit v1.2.3-60-g2f50