From: Stephan Beyer Date: Sat, 6 Jun 2020 16:04:36 +0000 (+0200) Subject: Fix crash on opening unconfigured local folder X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~169^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=131c1f1bac04a7069ceb903e4ae0709b183a3022;p=nextcloud-desktop.git Fix crash on opening unconfigured local folder When you try to open the local sync folder (by clicking on the folder symbol) for an account that has no folder configured, the client crashes. This commit changes User::openLocalFolder() to do nothing in case no local folder is configured. Signed-off-by: Stephan Beyer --- diff --git a/src/gui/tray/UserModel.cpp b/src/gui/tray/UserModel.cpp index 4c3fa4fb5..f0f8b95d2 100644 --- a/src/gui/tray/UserModel.cpp +++ b/src/gui/tray/UserModel.cpp @@ -417,12 +417,16 @@ ActivityListModel *User::getActivityModel() void User::openLocalFolder() { + const auto folder = getFolder(); + + if (folder != nullptr) { #ifdef Q_OS_WIN - QString path = "file:///" + this->getFolder()->path(); + QString path = "file:///" + folder->path(); #else - QString path = "file://" + this->getFolder()->path(); + QString path = "file://" + folder->path(); #endif - QDesktopServices::openUrl(path); + QDesktopServices::openUrl(path); + } } void User::login() const