summaryrefslogtreecommitdiffstats
path: root/apps/federation/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2016-02-15 16:59:49 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2016-02-15 18:03:10 +0100
commit835e70dbe2d68e8263affe8aa538f8b5cba25c5f (patch)
treebff5f6f93fffcf9895566a453e505b99167c9871 /apps/federation/lib
parentcc397da1bec21d27fbf9ff392958298014630b9c (diff)
downloadnextcloud-server-835e70dbe2d68e8263affe8aa538f8b5cba25c5f.tar.gz
nextcloud-server-835e70dbe2d68e8263affe8aa538f8b5cba25c5f.zip
throw exception if we don't find a token for a given server
Diffstat (limited to 'apps/federation/lib')
-rw-r--r--apps/federation/lib/dbhandler.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/federation/lib/dbhandler.php b/apps/federation/lib/dbhandler.php
index 9e44c72cc42..3ea84baa3eb 100644
--- a/apps/federation/lib/dbhandler.php
+++ b/apps/federation/lib/dbhandler.php
@@ -156,6 +156,7 @@ class DbHandler {
*
* @param string $url
* @return string
+ * @throws \Exception
*/
public function getToken($url) {
$hash = $this->hash($url);
@@ -165,6 +166,11 @@ class DbHandler {
->setParameter('url_hash', $hash);
$result = $query->execute()->fetch();
+
+ if (!isset($result['token'])) {
+ throw new \Exception('No token found for: ' . $url);
+ }
+
return $result['token'];
}