Skip to content

Commit

Permalink
Bail out if we can't find a backend id for the activesync folderid.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jan 14, 2014
1 parent cf2c813 commit ad66c79
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion framework/ActiveSync/lib/Horde/ActiveSync/Collections.php
Expand Up @@ -303,11 +303,16 @@ public function addCollection(array $collection, $requireSyncKey = false)
* @param $id The uid.
*
* @return string The backend server id.
* @throws Horde_ActiveSync_Exception
*/
public function getBackendIdForFolderUid($folderid)
{
$folder = $this->_cache->getFolder($folderid);
return $folder['serverid'];
if ($folder) {
return $folder['serverid'];
} else {
throw new Horde_ActiveSync_Exception('Folder not found in cache.');
}
}

/**
Expand Down
9 changes: 8 additions & 1 deletion framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php
Expand Up @@ -803,7 +803,14 @@ protected function _parseSyncFolders()
return false;
}

$this->_collections->addCollection($collection);
try {
$this->_collections->addCollection($collection);
} catch (Horde_ActiveSync_Exception $e) {
$this->_statusCode = self::STATUS_SERVERERROR;
$this->_handleError($collection);
return false;
}

if (!empty($collection['importedchanges'])) {
$this->_collections->importedChanges = true;
}
Expand Down

0 comments on commit ad66c79

Please sign in to comment.