diff --git a/lib/vcategories.php b/lib/vcategories.php
index a52c15f06702ae8004ed8f56d7c49b4dcbcc2b06..372706b185ac07376b32acad0296e551d55b5a63 100644
--- a/lib/vcategories.php
+++ b/lib/vcategories.php
@@ -541,9 +541,13 @@ class OC_VCategories {
 	* 	Defaults to the type set in the instance
 	* @returns boolean Returns false on error.
 	*/
-	public function purgeObjects($ids, $type = null) {
+	public function purgeObjects(array $ids, $type = null) {
 		$type = is_null($type) ? $this->type : $type;
-		$updates = array();
+		if(count($ids) === 0) {
+			// job done ;)
+			return true;
+		}
+		$updates = $ids();
 		try {
 			$query = 'DELETE FROM `' . self::RELATION_TABLE . '` ';
 			$query .= 'WHERE `objid` IN (' . str_repeat('?,', count($ids)-1) . '?) ';
@@ -557,7 +561,7 @@ class OC_VCategories {
 				return false;
 			}
 		} catch(Exception $e) {
-			OCP\Util::writeLog('core', __METHOD__.', exception: '.$e->getMessage(),
+			OCP\Util::writeLog('core', __METHOD__.', exception: ' . $e->getMessage(),
 				OCP\Util::ERROR);
 			return false;
 		}