From 2d994620d1c6de5c2ba085ba50d28be27e27a1fb Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 26 Aug 2021 16:58:07 +0200 Subject: [PATCH] Utils: Fix setting the path via slotBrowse() Amends: 0d7f357294c89fd71d7404350c736f008bb36b8d Change-Id: Iae5e13b5d4d869d7e727f614f540767fca32d770 Reviewed-by: hjk --- src/libs/utils/pathchooser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 385c15d6890..01e9c7d7109 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -459,8 +459,9 @@ void PathChooser::slotBrowse() window()->activateWindow(); // Delete trailing slashes unless it is "/" only. - if (newPath.endsWith("/") && newPath.path().size() > 1) { - newPath = newPath.withNewPath(newPath.path().chopped(1)); + if (!newPath.isEmpty()) { + if (newPath.endsWith("/") && newPath.path().size() > 1) + newPath = newPath.withNewPath(newPath.path().chopped(1)); setFilePath(newPath); }