]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/attachmentlist.php
Better fallback on UnsupportedMediaException
[quix0rs-gnu-social.git] / lib / attachmentlist.php
index 073581593381fb3ea3405286d663b71670ae8705..74248313ebadd095235170cc26b54915323ab9da 100644 (file)
@@ -204,7 +204,7 @@ class AttachmentListItem extends Widget
         try {
             $thumb = $this->attachment->getThumbnail();
             $this->out->element('img', array('alt' => '', 'src' => $thumb->getUrl(), 'width' => $thumb->width, 'height' => $thumb->height));
-        } catch (Exception $e) {
+        } catch (UnsupportedMediaException $e) {
             // Image representation unavailable
         }
     }
@@ -325,6 +325,7 @@ class Attachment extends AttachmentListItem
                     try {
                         $thumb = $this->attachment->getThumbnail();
                         $poster = $thumb->getUrl();
+                        unset ($thumb);
                     } catch (Exception $e) {
                         $poster = null;
                     }