summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-01-07 11:46:24 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-01-07 14:36:37 +0100
commitfaa68b28cb93bb7368a1817cbbe59880ce3bce5b (patch)
treea1e6a66b16159748429fb0ffdf47d83e19b227c6 /lib/private/legacy
parent5b216500976019734e67b3edd8b17c8e18c9c8cc (diff)
downloadnextcloud-server-faa68b28cb93bb7368a1817cbbe59880ce3bce5b.tar.gz
nextcloud-server-faa68b28cb93bb7368a1817cbbe59880ce3bce5b.zip
Only return 1 type
Throw proper exception if we can't get the mimetype for a preview. Catch it later on so we can just return a not found for the preview. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r--lib/private/legacy/image.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/legacy/image.php b/lib/private/legacy/image.php
index 925548ef26d..a0159b927f9 100644
--- a/lib/private/legacy/image.php
+++ b/lib/private/legacy/image.php
@@ -305,11 +305,12 @@ class OC_Image implements \OCP\IImage {
}
/**
- * @return null|string Returns the mimetype of the data
+ * @return string Returns the mimetype of the data. Returns the empty string
+ * if the data is not valid.
*/
public function dataMimeType() {
if (!$this->valid()) {
- return null;
+ return '';
}
switch ($this->mimeType) {