1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Fixed possible crash on attempt to load missing font(?)

This commit is contained in:
Ivan Savenko 2023-08-06 17:47:12 +03:00
parent c524caee5c
commit 6ddac8376d

View File

@ -26,6 +26,12 @@
void CBitmapFont::loadModFont(const std::string & modName, const ResourceID & resource)
{
if (!CResourceHandler::get(modName)->existsResource(resource))
{
logGlobal->error("Failed to load font %s from mod %s", resource.getName(), modName);
return;
}
auto data = CResourceHandler::get(modName)->load(resource)->readAll();
std::string modLanguage = CGI->modh->getModLanguage(modName);
std::string modEncoding = Languages::getLanguageOptions(modLanguage).encoding;