Skip to content

Commit

Permalink
Fixed error when group question throws exception: isFollow of NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
greyexpert committed Apr 20, 2015
1 parent 4e5b471 commit 326ccce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/feed_item.php
Expand Up @@ -158,6 +158,8 @@ public function onBeforeRender()
'onclick' => $onClickStr,
'string' => null
);

$userId = OW::getUser()->getId();

if ( $configs['enable_follow'] )
{
Expand All @@ -166,8 +168,6 @@ public function onBeforeRender()

if ( QUESTIONS_BOL_Service::getInstance()->isCurrentUserCanInteract($this->question) )
{
$userId = OW::getUser()->getId();

$isFollowing = QUESTIONS_BOL_Service::getInstance()->isFollow($userId, $this->question->id);
$onClickStr = $isFollowing
? $jsSelector . '.unfollowQuestion();'
Expand Down

0 comments on commit 326ccce

Please sign in to comment.