Skip to content

Commit

Permalink
fix: check if path is empty (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiichi3227 authored and vaxerski committed Jul 17, 2024
1 parent 58a2811 commit 75991fd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/config/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 75991fd

Please sign in to comment.