[Pkg-owncloud-commits] [owncloud-client] 57/219: Return from Folder::slotPollTimerTimeout() if the account object is 0

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 11 14:43:09 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 c0131695c561be9fb6f5d55972ac785be12a00ad
Author: Daniel Molkentin <danimo at owncloud.com>
Date:   Tue Sep 2 14:51:03 2014 +0200

    Return from Folder::slotPollTimerTimeout() if the account object is 0
    
    Right now, we crash instead. This can happen if a folder is created
    when an account object is not (anymore/yet) created.
    
    Fixes #2142
---
 src/mirall/folder.cpp | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp
index c3edd13..914a342 100644
--- a/src/mirall/folder.cpp
+++ b/src/mirall/folder.cpp
@@ -255,8 +255,16 @@ void Folder::slotPollTimerTimeout()
 {
     qDebug() << "* Polling" << alias() << "for changes. (time since last sync:" << (_timeSinceLastSync.elapsed() / 1000) << "s)";
 
-    if (_paused || AccountManager::instance()->account()->state() != Account::Connected) {
-        qDebug() << "Not syncing.  :" << _paused << AccountManager::instance()->account()->state();
+
+    Account *account = AccountManager::instance()->account();
+
+    if (!account) {
+        qDebug() << Q_FUNC_INFO << "No valid account object";
+        return;
+    }
+
+    if (_paused || account->state() != Account::Connected) {
+        qDebug() << "Not syncing.  :" << _paused << account->state();
         return;
     }
 
@@ -265,8 +273,8 @@ void Folder::slotPollTimerTimeout()
         qDebug() << "** Force Sync now, state is " << _syncResult.statusString();
         emit scheduleToSync(alias());
     } else {
-        // do the ordinary etag chech for the root folder.
-        RequestEtagJob* job = new RequestEtagJob(AccountManager::instance()->account(), remotePath(), this);
+        // do the ordinary etag check for the root folder.
+        RequestEtagJob* job = new RequestEtagJob(account, remotePath(), this);
         // check if the etag is different
         QObject::connect(job, SIGNAL(etagRetreived(QString)), this, SLOT(etagRetreived(QString)));
         QObject::connect(job, SIGNAL(networkError(QNetworkReply*)), this, SLOT(slotNetworkUnavailable()));

-- 
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