Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Haertl <jus@bitgrid.net>2016-10-17 17:31:07 +0300
committerJulius Haertl <jus@bitgrid.net>2016-11-18 12:23:25 +0300
commit3a400f92d1936b2b752d813cbb27632d6acb9904 (patch)
tree3b9ab6f150ab8f54f457cb4eb0ec3a1e56a7049f /apps/theming/lib/Controller
parentcc8b1d382910e13c0825e5a3fdb33276f65cf2bd (diff)
Replace null return with NotFoundException
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/lib/Controller')
-rw-r--r--apps/theming/lib/Controller/IconController.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php
index 887dba8a68a..08d5b50120f 100644
--- a/apps/theming/lib/Controller/IconController.php
+++ b/apps/theming/lib/Controller/IconController.php
@@ -30,6 +30,7 @@ use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataDisplayResponse;
use OCP\AppFramework\Http\FileDisplayResponse;
use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\Files\NotFoundException;
use OCP\IRequest;
use OCA\Theming\Util;
use OCP\IConfig;
@@ -89,8 +90,9 @@ class IconController extends Controller {
* @return FileDisplayResponse
*/
public function getThemedIcon($app, $image) {
- $iconFile = $this->imageManager->getCachedImage("icon-" . $app . '-' . str_replace("/","_",$image));
- if ($iconFile === null) {
+ try {
+ $iconFile = $this->imageManager->getCachedImage("icon-" . $app . '-' . str_replace("/","_",$image));
+ } catch (NotFoundException $exception) {
$icon = $this->iconBuilder->colorSvg($app, $image);
$iconFile = $this->imageManager->setCachedImage("icon-" . $app . '-' . str_replace("/","_",$image), $icon);
}
@@ -115,8 +117,9 @@ class IconController extends Controller {
*/
public function getFavicon($app = "core") {
if ($this->themingDefaults->shouldReplaceIcons()) {
- $iconFile = $this->imageManager->getCachedImage('favIcon-' . $app);
- if($iconFile === null) {
+ try {
+ $iconFile = $this->imageManager->getCachedImage('favIcon-' . $app);
+ } catch (NotFoundException $exception) {
$icon = $this->iconBuilder->getFavicon($app);
$iconFile = $this->imageManager->setCachedImage('favIcon-' . $app, $icon);
}
@@ -146,8 +149,9 @@ class IconController extends Controller {
*/
public function getTouchIcon($app = "core") {
if ($this->themingDefaults->shouldReplaceIcons()) {
- $iconFile = $this->imageManager->getCachedImage('touchIcon-' . $app);
- if ($iconFile === null) {
+ try {
+ $iconFile = $this->imageManager->getCachedImage('touchIcon-' . $app);
+ } catch (NotFoundException $exception) {
$icon = $this->iconBuilder->getTouchIcon($app);
$iconFile = $this->imageManager->setCachedImage('touchIcon-' . $app, $icon);
}
@@ -165,4 +169,4 @@ class IconController extends Controller {
}
return $response;
}
-} \ No newline at end of file
+}