Skip to content

Commit

Permalink
fix null parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed Nov 3, 2017
1 parent 85dbcad commit 724b34b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/Activity/ProviderParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ protected function parseCircleEvent(IEvent &$event, Circle $circle, $remote, $ow
'circle' => $this->generateCircleParameter($circle)
];

$remote = $this->generateRemoteCircleParameter($remote);
if ($remote !== null) {
$data['remote'] = $remote;
$remoteCircle = $this->generateRemoteCircleParameter($remote);
if ($remoteCircle !== null) {
$data['remote'] = $remoteCircle;
}

if ($this->isViewerTheAuthor($circle, $this->activityManager->getCurrentUserId())) {
Expand Down Expand Up @@ -329,7 +329,12 @@ protected function generateCircleParameter(Circle $circle) {
*
* @return array<string,string|integer>
*/
protected function generateRemoteCircleParameter(FederatedLink $link) {
protected function generateRemoteCircleParameter($link) {

if ($link === null) {
return null;
}

return [
'type' => 'circle',
'id' => $link->getUniqueId(),
Expand Down

0 comments on commit 724b34b

Please sign in to comment.