mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 13:05:59 +01:00
renderer: fixup crashes on inaccessible files for bg
This commit is contained in:
parent
640d161851
commit
d597ae41b9
1 changed files with 4 additions and 6 deletions
|
@ -2688,12 +2688,10 @@ void CHyprOpenGLImpl::createBGTextureForMonitor(CMonitor* pMonitor) {
|
|||
texPath += ".png";
|
||||
|
||||
// check if wallpapers exist
|
||||
if (!std::filesystem::exists(texPath)) {
|
||||
// try local
|
||||
texPath = texPath.substr(0, 5) + "local/" + texPath.substr(5);
|
||||
|
||||
if (!std::filesystem::exists(texPath))
|
||||
return; // the texture will be empty, oh well. We'll clear with a solid color anyways.
|
||||
std::error_code err;
|
||||
if (!std::filesystem::exists(texPath, err)) {
|
||||
Debug::log(ERR, "createBGTextureForMonitor: failed, file doesn't exist or access denied, ec: {}", err.message());
|
||||
return; // the texture will be empty, oh well. We'll clear with a solid color anyways.
|
||||
}
|
||||
|
||||
createBackgroundTexture(texPath);
|
||||
|
|
Loading…
Reference in a new issue