summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVictor Dubiniuk <victor.dubiniuk@gmail.com>2013-10-04 23:24:38 +0300
committerVictor Dubiniuk <victor.dubiniuk@gmail.com>2013-10-04 23:24:38 +0300
commit8da1aac1d0065e2da6841bf98b8bb60fcefa14c8 (patch)
treeaa8d96e20c57a441711d6fbae0cf39b397efb952 /lib
parentef65037211f9111bb5c77fe657e50dc948db4f75 (diff)
downloadnextcloud-server-8da1aac1d0065e2da6841bf98b8bb60fcefa14c8.tar.gz
nextcloud-server-8da1aac1d0065e2da6841bf98b8bb60fcefa14c8.zip
Check result only once
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/cache/cache.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php
index 82f5f504cba..364a50d377c 100644
--- a/lib/private/files/cache/cache.php
+++ b/lib/private/files/cache/cache.php
@@ -87,9 +87,11 @@ class Cache {
protected function loadMimetypes(){
$result = \OC_DB::executeAudited('SELECT `id`, `mimetype` FROM `*PREFIX*mimetypes`', array());
- while ($result && $row = $result->fetchRow()) {
- self::$mimetypeIds[$row['mimetype']] = $row['id'];
- self::$mimetypes[$row['id']] = $row['mimetype'];
+ if ($result) {
+ while ($row = $result->fetchRow()) {
+ self::$mimetypeIds[$row['mimetype']] = $row['id'];
+ self::$mimetypes[$row['id']] = $row['mimetype'];
+ }
}
}