[Pkg-owncloud-commits] [owncloud-client] 36/83: Fix crash when the account config is gone and there are still folder
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat May 31 11:31:41 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit f9263da3dedc8093d7655b16ab863c2f4f9fd378
Author: Olivier Goffart <ogoffart at woboq.com>
Date: Mon May 26 11:08:32 2014 +0200
Fix crash when the account config is gone and there are still folder
In rare case (due to a bug in QSettings) the account config may disapear
We should not crash in that case
---
src/mirall/folder.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp
index 91bbbf8..6ba5abf 100644
--- a/src/mirall/folder.cpp
+++ b/src/mirall/folder.cpp
@@ -91,6 +91,14 @@ Folder::Folder(const QString &alias, const QString &path, const QString& secondP
bool Folder::init()
{
+ Account *account = AccountManager::instance()->account();
+ if (!account) {
+ // Normaly this should not happen, but it could be that there is something
+ // wrong with the config and it is better not to crash.
+ qWarning() << "WRN: No account configured, can't sync";
+ return false;
+ }
+
QString url = Utility::toCSyncScheme(remoteUrl().toString());
QString localpath = path();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list