summaryrefslogtreecommitdiffstats
path: root/lib/vcategories.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vcategories.php')
-rw-r--r--lib/vcategories.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/vcategories.php b/lib/vcategories.php
index f5123adeeb6..6b1d6a316f1 100644
--- a/lib/vcategories.php
+++ b/lib/vcategories.php
@@ -55,7 +55,10 @@ class OC_VCategories {
$this->app = $app;
$this->user = is_null($user) ? OC_User::getUser() : $user;
$categories = trim(OC_Preferences::getValue($this->user, $app, self::PREF_CATEGORIES_LABEL, ''));
- $this->categories = $categories != '' ? @unserialize($categories) : $defcategories;
+ if ($categories) {
+ $categories = @unserialize($categories);
+ }
+ $this->categories = is_array($categories) ? $categories : $defcategories;
}
/**