Fixed (maybe) segfault if font is not found
authorPerttu Ahola <celeron55@gmail.com>
Sat, 8 Jan 2011 16:57:21 +0000 (18:57 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 8 Jan 2011 16:57:21 +0000 (18:57 +0200)
src/main.cpp

index a0da103c94aa06974495ea867aa1b80f99b188bb..e6445f4a3bd7c4e0ef52ea121e7dda483e7261b1 100644 (file)
@@ -1440,6 +1440,8 @@ int main(int argc, char *argv[])
        gui::IGUIFont* font = guienv->getFont(porting::getDataPath("fontlucida.png").c_str());\r
        if(font)\r
                skin->setFont(font);\r
+       // If font was not found, this will get us one\r
+       font = skin->getFont();\r
        \r
        u32 text_height = font->getDimension(L"Hello, world!").Height;\r
        dstream<<"text_height="<<text_height<<std::endl;\r