mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Fixed possible crash on attempt to load missing font(?)
This commit is contained in:
@@ -26,6 +26,12 @@
|
|||||||
|
|
||||||
void CBitmapFont::loadModFont(const std::string & modName, const ResourceID & resource)
|
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();
|
auto data = CResourceHandler::get(modName)->load(resource)->readAll();
|
||||||
std::string modLanguage = CGI->modh->getModLanguage(modName);
|
std::string modLanguage = CGI->modh->getModLanguage(modName);
|
||||||
std::string modEncoding = Languages::getLanguageOptions(modLanguage).encoding;
|
std::string modEncoding = Languages::getLanguageOptions(modLanguage).encoding;
|
||||||
|
|||||||
Reference in New Issue
Block a user