summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-10-08 17:00:50 +0200
committerGitHub <noreply@github.com>2018-10-08 17:00:50 +0200
commitfe2a60082334f53d75411bd8c05928778afadc04 (patch)
tree0a4bcffd54c1f37ffb1a127e4a1314dc20fc1287 /apps
parent8110a3be699bbdea96df30472dce7862e0964901 (diff)
parent970242b6ca79a0dbb1ac1a868c7b82c7aa49bd8a (diff)
downloadnextcloud-server-fe2a60082334f53d75411bd8c05928778afadc04.tar.gz
nextcloud-server-fe2a60082334f53d75411bd8c05928778afadc04.zip
Merge pull request #10839 from nextcloud/bugfix/10212/use_class_implementation
adjust Calendar resource / room interfaces to use class implementation
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php32
1 files changed, 24 insertions, 8 deletions
diff --git a/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php b/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
index c5f8f6586e9..3a9e3def05d 100644
--- a/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
+++ b/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
@@ -113,8 +113,12 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
foreach($sortedResources['new'] as $backendId => $newResources) {
foreach ($newResources as $newResource) {
- $resource = $this->resourceManager->getBackend($backendId)
- ->getResource($newResource);
+ $backend = $this->resourceManager->getBackend($backendId);
+ if ($backend === null) {
+ continue;
+ }
+
+ $resource = $backend->getResource($newResource);
$this->addToCache($this->resourceDbTable, $resource);
}
}
@@ -126,8 +130,12 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
}
foreach($sortedResources['edited'] as $backendId => $editedResources) {
foreach ($editedResources as $editedResource) {
- $resource = $this->resourceManager->getBackend($backendId)
- ->getResource($editedResource);
+ $backend = $this->resourceManager->getBackend($backendId);
+ if ($backend === null) {
+ continue;
+ }
+
+ $resource = $backend->getResource($editedResource);
$this->updateCache($this->resourceDbTable, $resource);
}
}
@@ -157,8 +165,12 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
foreach($sortedRooms['new'] as $backendId => $newRooms) {
foreach ($newRooms as $newRoom) {
- $resource = $this->roomManager->getBackend($backendId)
- ->getRoom($newRoom);
+ $backend = $this->roomManager->getBackend($backendId);
+ if ($backend === null) {
+ continue;
+ }
+
+ $resource = $backend->getRoom($newRoom);
$this->addToCache($this->roomDbTable, $resource);
}
}
@@ -170,8 +182,12 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
}
foreach($sortedRooms['edited'] as $backendId => $editedRooms) {
foreach ($editedRooms as $editedRoom) {
- $resource = $this->roomManager->getBackend($backendId)
- ->getRoom($editedRoom);
+ $backend = $this->roomManager->getBackend($backendId);
+ if ($backend === null) {
+ continue;
+ }
+
+ $resource = $backend->getRoom($editedRoom);
$this->updateCache($this->roomDbTable, $resource);
}
}