From 6ca5518ff13e9af584c023998d2c566203d87f3b Mon Sep 17 00:00:00 2001 From: Michael <13953785+Laserlicht@users.noreply.github.com> Date: Fri, 11 Aug 2023 20:09:41 +0200 Subject: [PATCH] Buxfix --- client/lobby/SelectionTab.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/client/lobby/SelectionTab.cpp b/client/lobby/SelectionTab.cpp index 436cd3d7d..ec26af22f 100644 --- a/client/lobby/SelectionTab.cpp +++ b/client/lobby/SelectionTab.cpp @@ -374,8 +374,13 @@ auto SelectionTab::checkSubfolder(std::string path) filetree.erase(filetree.begin()); std::string pathWithoutPrefix = boost::algorithm::join(filetree, "/"); - filetree.pop_back(); - ret.baseFolder = boost::algorithm::join(filetree, "/"); + if(!filetree.empty()) + { + filetree.pop_back(); + ret.baseFolder = boost::algorithm::join(filetree, "/"); + } + else + ret.baseFolder = ""; if(boost::algorithm::starts_with(ret.baseFolder, curFolder)) { @@ -613,8 +618,6 @@ int SelectionTab::getLine(const Point & clickPos) const void SelectionTab::selectFileName(std::string fname) { - boost::to_upper(fname); - auto [folderName, baseFolder, parentExists, fileInFolder] = checkSubfolder(fname); curFolder = baseFolder != "" ? baseFolder + "/" : "";