From: Hypolite Petovan Date: Sun, 14 Oct 2018 11:10:08 +0000 (-0400) Subject: [twitter] Fix Undefined property: stdClass::$media_id_string notice X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=da861182833aba1b41c7b387874c7a60adb2a6de;p=friendica-addons.git [twitter] Fix Undefined property: stdClass::$media_id_string notice --- diff --git a/twitter/twitter.php b/twitter/twitter.php index 5a808d39..9f07fa52 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -591,7 +591,11 @@ function twitter_post_hook(App $a, array &$b) unlink($tempfile); - $post['media_ids'] = $media->media_id_string; + if (isset($media->media_id_string)) { + $post['media_ids'] = $media->media_id_string; + } else { + throw new Exception('Failed upload of ' . $image); + } } catch (Exception $e) { logger('Exception when trying to send to Twitter: ' . $e->getMessage());