diff --git a/lib/vcategories.php b/lib/vcategories.php
index f5123adeeb641ff3e87c73bf7c9e45b777af6b4e..6b1d6a316f1660bcd0e218e793892041892abffe 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;
 	}
 
 	/**