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); }