diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-01-09 02:27:51 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-01-09 02:27:51 +0100 |
commit | 6c5925397871b018fa6bad147b0055a6ab1d2f5d (patch) | |
tree | ec0772a2f93f834e686efbdf76504e9f7214cce1 /lib | |
parent | 6a5f12beca175a0b9a951fa844eacfd21a8df3de (diff) | |
parent | ceaaab6295ad30e066c9d5505e9131136bafbdb8 (diff) | |
download | nextcloud-server-6c5925397871b018fa6bad147b0055a6ab1d2f5d.tar.gz nextcloud-server-6c5925397871b018fa6bad147b0055a6ab1d2f5d.zip |
Merge pull request #13179 from owncloud/fix-fatal-php-error-for-not-existing-files
Verify whether type is correct
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/preview.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/preview.php b/lib/private/preview.php index a586c94fd11..c7ef00652aa 100644 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -200,14 +200,15 @@ class Preview { /** * set the path of the file you want a thumbnail from * @param string $file - * @return \OC\Preview $this + * @return $this */ public function setFile($file) { $this->file = $file; $this->info = null; + if ($file !== '') { $this->getFileInfo(); - if($this->info !== null && $this->info !== false) { + if($this->info instanceof \OCP\Files\FileInfo) { $this->mimeType = $this->info->getMimetype(); } } |