From a137f542c87fd583b58a485d974f0a58f6492c7e Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 14 Jun 2016 19:49:03 +0200 Subject: [PATCH] Changed: Only remove directories if not empty path --- .../ryzom_installer/src/operationdialog.cpp | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index 0786e01e0..2b7c9ea98 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -722,12 +722,15 @@ void COperationDialog::deleteComponentsServers() QString path = server.getDirectory(); - QDir dir(path); - - if (dir.exists() && !dir.removeRecursively()) + if (!path.isEmpty()) { - emit fail(tr("Unable to delete files for client %1").arg(server.name)); - return; + QDir dir(path); + + if (dir.exists() && !dir.removeRecursively()) + { + emit fail(tr("Unable to delete files for client %1").arg(server.name)); + return; + } } } @@ -761,10 +764,15 @@ void COperationDialog::deleteComponentsProfiles() QString path = profile.getDirectory(); - if (dir.exists() && !dir.removeRecursively()) + if (!path.isEmpty()) { - emit fail(tr("Unable to delete files for profile %1").arg(profile.name)); - return; + QDir dir(path); + + if (dir.exists() && !dir.removeRecursively()) + { + emit fail(tr("Unable to delete files for profile %1").arg(profile.name)); + return; + } } // delete profile