Browse Source

MineTag fix

Bastien Sevajol 10 years ago
parent
commit
f38b187e34
1 changed files with 9 additions and 5 deletions
  1. 9 5
      src/Muzich/CoreBundle/Mining/Tag/TagData.php

+ 9 - 5
src/Muzich/CoreBundle/Mining/Tag/TagData.php View File

@@ -20,11 +20,15 @@ class TagData extends Base
20 20
   public function getTagOrderForDiffusions(User $user)
21 21
   {
22 22
     $user_tags = $this->getUserTagsTags($user, 'element_diffusion_tags');
23
-    
24
-   if (count($tags_ordereds = $user_tags->getElementDiffusionTags()))
25
-     return $tags_ordereds;
26
-   
27
-   return array();
23
+    $user_tags = null;
24
+    if ($user_tags)
25
+    {
26
+      if (count($tags_ordereds = $user_tags->getElementDiffusionTags()))
27
+      {
28
+        return $tags_ordereds;
29
+      }
30
+    }
31
+    return array();
28 32
   }
29 33
   
30 34
   protected function getUserTagsTags(User $user, $field)