From a98391b976ba7dd544af6a0d16b324efb2fc7a3c Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 26 Jun 2013 10:57:37 +0200 Subject: [PATCH] some minor improvements to preview lib --- lib/preview.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/preview.php b/lib/preview.php index 3564fe3df4..87e2e78d1d 100755 --- a/lib/preview.php +++ b/lib/preview.php @@ -323,7 +323,7 @@ class Preview { }else{ $mimetype = $this->fileview->getMimeType($file); - $preview; + $preview = null; foreach(self::$providers as $supportedmimetype => $provider) { if(!preg_match($supportedmimetype, $mimetype)) { @@ -350,6 +350,11 @@ class Preview { break; } + + if(is_null($preview) || $preview === false) { + $preview = new \OC_Image(); + } + $this->preview = $preview; } $this->resizeAndCrop();