mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Fixed some potential crashes in ImageComponent caused by invalid theme configuration.
This commit is contained in:
parent
c03d50e0e5
commit
819d1b0341
|
@ -146,9 +146,14 @@ void ImageComponent::setImage(const std::string& path, bool tile)
|
||||||
if (!mForceLoad && (path[0] == ':') && (path[1] == '/')) {
|
if (!mForceLoad && (path[0] == ':') && (path[1] == '/')) {
|
||||||
mDynamic = false;
|
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(
|
const bool isScalable {
|
||||||
path.size() - 4, std::string::npos)) == ".svg" :
|
(path != "" && path.length() > 4) ?
|
||||||
|
Utils::String::toLower(path.substr(path.size() - 4, std::string::npos)) == ".svg" :
|
||||||
false};
|
false};
|
||||||
|
|
||||||
// Create an initial blank texture if needed.
|
// Create an initial blank texture if needed.
|
||||||
|
|
Loading…
Reference in a new issue