mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Fixed some potential crashes in ImageComponent caused by invalid theme configuration.
This commit is contained in:
parent
c03d50e0e5
commit
819d1b0341
|
@ -146,10 +146,15 @@ void ImageComponent::setImage(const std::string& path, bool tile)
|
|||
if (!mForceLoad && (path[0] == ':') && (path[1] == '/')) {
|
||||
mDynamic = false;
|
||||
}
|
||||
else if (Utils::FileSystem::isDirectory(path)) {
|
||||
LOG(LogError) << "ImageComponent: Path is a directory and not a file: \"" << path << "\"";
|
||||
return;
|
||||
}
|
||||
|
||||
const bool isScalable {path != "" ? Utils::String::toLower(path.substr(
|
||||
path.size() - 4, std::string::npos)) == ".svg" :
|
||||
false};
|
||||
const bool isScalable {
|
||||
(path != "" && path.length() > 4) ?
|
||||
Utils::String::toLower(path.substr(path.size() - 4, std::string::npos)) == ".svg" :
|
||||
false};
|
||||
|
||||
// Create an initial blank texture if needed.
|
||||
if (path.empty() || !ResourceManager::getInstance().fileExists(path)) {
|
||||
|
|
Loading…
Reference in a new issue