mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-07 23:51:55 -07:00
renderer: fixup crashes on inaccessible files for bg
This commit is contained in:
@@ -2688,11 +2688,9 @@ void CHyprOpenGLImpl::createBGTextureForMonitor(CMonitor* pMonitor) {
|
|||||||
texPath += ".png";
|
texPath += ".png";
|
||||||
|
|
||||||
// check if wallpapers exist
|
// check if wallpapers exist
|
||||||
if (!std::filesystem::exists(texPath)) {
|
std::error_code err;
|
||||||
// try local
|
if (!std::filesystem::exists(texPath, err)) {
|
||||||
texPath = texPath.substr(0, 5) + "local/" + texPath.substr(5);
|
Debug::log(ERR, "createBGTextureForMonitor: failed, file doesn't exist or access denied, ec: {}", err.message());
|
||||||
|
|
||||||
if (!std::filesystem::exists(texPath))
|
|
||||||
return; // the texture will be empty, oh well. We'll clear with a solid color anyways.
|
return; // the texture will be empty, oh well. We'll clear with a solid color anyways.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user