Skip to content

Commit

Permalink
Trying to catch some failures
Browse files Browse the repository at this point in the history
As part of #45
(cherry picked from commit 10e07d6)
  • Loading branch information
oparoz committed Mar 3, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 7f69e75 commit 0deae2e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions service/infoservice.php
Original file line number Diff line number Diff line change
@@ -153,7 +153,11 @@ public function getImages($folderData) {
private function searchFolder($folder, $subDepth = 0) {
$albumImageCounter = 0;
$subFolders = [];
$nodes = $folder->getDirectoryListing();
try {
$nodes = $folder->getDirectoryListing();
} catch (\Exception $exception) {
$this->logAndThrowNotFound($exception->getMessage());
}

foreach ($nodes as $node) {
//$this->logger->debug("Sub-Node path : {path}", ['path' => $node->getPath()]);
@@ -228,7 +232,12 @@ private function searchSubFolders($subFolders, $albumImageCounter, $subDepth) {
* @return bool
*/
private function isPreviewAvailable($node) {
$mimeType = $node->getMimetype();
// This can break on oC 8. See https://github.com/owncloud/core/issues/14390
try {
$mimeType = $node->getMimetype();
} catch (\Exception $exception) {
return false;
}

if (!$file->isMounted() && in_array($mimeType, $this->supportedMimes)) {
$imagePath = $node->getPath();

0 comments on commit 0deae2e

Please sign in to comment.