Permalink
Browse files

G+ plugin: Avoid undefined property error, closes #1033

  • Loading branch information...
1 parent 68aec28 commit 0b192c98992dcfaa50aad6b12918717dfc6b72b7 @ginatrapani ginatrapani committed Nov 4, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 webapp/plugins/googleplus/model/class.GooglePlusCrawler.php
@@ -219,19 +219,19 @@ public function fetchInstanceUserPosts() {
$post_dao->updatePostText($post['post_id'], 'google+', $post['post_text']);
}
- if (isset($item->object->attachments)) {
+ if (isset($item->object->attachments) && isset($item->object->attachments[0]->url)) {
$link_url = $item->object->attachments[0]->url;
$link = new Link(array(
- "url"=>$link_url,
- "expanded_url"=>$link_url,
+ "url"=>$link_url,
+ "expanded_url"=>$link_url,
"image_src"=>(isset($item->object->attachments[0]->image->url))
?$item->object->attachments[0]->image->url:'',
- "caption"=>'',
+ "caption"=>'',
"description"=>(isset($item->object->attachments[0]->content))
?$item->object->attachments[0]->content:'',
"title"=>(isset($item->object->attachments[0]->displayName))
?$item->object->attachments[0]->displayName:'',
- "post_key"=>$inserted_post_key
+ "post_key"=>$inserted_post_key
));
$added_links = $link_dao->insert($link);
}

0 comments on commit 0b192c9

Please sign in to comment.