diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-01-08 18:57:21 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-01-08 18:57:21 +0200 |
commit | c3159160fa3f3091f06b32bc41a57bc2969903eb (patch) | |
tree | 4e58648ec85c6c018f17388800f9d5d0a685e4a1 | |
parent | 769a86be1930d9318fb600a56e6506072baa0523 (diff) | |
download | minetest-c3159160fa3f3091f06b32bc41a57bc2969903eb.tar.gz minetest-c3159160fa3f3091f06b32bc41a57bc2969903eb.tar.bz2 minetest-c3159160fa3f3091f06b32bc41a57bc2969903eb.zip |
Fixed (maybe) segfault if font is not found
-rw-r--r-- | src/main.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index a0da103c9..e6445f4a3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1440,6 +1440,8 @@ int main(int argc, char *argv[]) gui::IGUIFont* font = guienv->getFont(porting::getDataPath("fontlucida.png").c_str());
if(font)
skin->setFont(font);
+ // If font was not found, this will get us one
+ font = skin->getFont();
u32 text_height = font->getDimension(L"Hello, world!").Height;
dstream<<"text_height="<<text_height<<std::endl;
|