mirror of
https://github.com/hyprwm/hyprpaper.git
synced 2024-11-16 22:25:59 +01:00
fix: check if path is empty (#116)
This commit is contained in:
parent
c447f1195c
commit
f8cab3c370
1 changed files with 3 additions and 0 deletions
|
@ -215,6 +215,9 @@ void CConfigManager::handleUnloadAll(const std::string& COMMAND, const std::stri
|
|||
|
||||
// trim from both ends
|
||||
std::string CConfigManager::trimPath(std::string path) {
|
||||
if (path.empty())
|
||||
return "";
|
||||
|
||||
// trims whitespaces, tabs and new line feeds
|
||||
size_t pathStartIndex = path.find_first_not_of(" \t\r\n");
|
||||
size_t pathEndIndex = path.find_last_not_of(" \t\r\n");
|
||||
|
|
Loading…
Reference in a new issue