]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Don't show large image if it's not available
authorEvan Prodromou <evan@status.net>
Thu, 25 Aug 2011 15:37:15 +0000 (11:37 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 25 Aug 2011 15:37:15 +0000 (11:37 -0400)
lib/activityobject.php

index 228473d5189599b90346c24a1a1f26978cbeb36f..0343fa664ed374315cf9b3bea12b21e0a7132ce8 100644 (file)
@@ -699,7 +699,7 @@ class ActivityObject
                 // XXX: Not sure what the best avatar is to use for the
                 // author's "image". For now, I'm using the large size.
 
-                $avatarLarge      = null;
+                $imgLink          = null;
                 $avatarMediaLinks = array();
 
                 foreach ($this->avatarLinks as $a) {
@@ -724,7 +724,9 @@ class ActivityObject
                 $object['avatarLinks'] = $avatarMediaLinks; // extension
 
                 // image
-                $object['image']  = $imgLink->asArray();
+                if (!empty($imgLink)) {
+                    $object['image']  = $imgLink->asArray();
+                }
             }
 
             // objectType