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:
parent
c524caee5c
commit
6ddac8376d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user