X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FQnA%2Factions%2Fqnashowquestion.php;h=cc8f98448aa1e259f4d14bb96aba31ad43999cd3;hb=78dc376f017cd7a9ee746e961dd8eefb8941eff2;hp=ca2cb74ba1d751c2279b4c5db7007a39f154b02d;hpb=f04452c70a2cdc56d001bb5442af8f51382444bd;p=quix0rs-gnu-social.git diff --git a/plugins/QnA/actions/qnashowquestion.php b/plugins/QnA/actions/qnashowquestion.php index ca2cb74ba1..cc8f98448a 100644 --- a/plugins/QnA/actions/qnashowquestion.php +++ b/plugins/QnA/actions/qnashowquestion.php @@ -61,7 +61,7 @@ class QnashowquestionAction extends ShownoticeAction $this->id = $this->trimmed('id'); - $this->question = QnA_Question::staticGet('id', $this->id); + $this->question = QnA_Question::getKV('id', $this->id); if (empty($this->question)) { // TRANS: Client exception thrown trying to view a non-existing question. @@ -76,7 +76,7 @@ class QnashowquestionAction extends ShownoticeAction throw new ClientException(_m('No such question notice.'), 404); } - $this->user = User::staticGet('id', $this->question->profile_id); + $this->user = User::getKV('id', $this->question->profile_id); if (empty($this->user)) { // TRANS: Client exception thrown trying to view a question of a non-existing user. @@ -90,7 +90,11 @@ class QnashowquestionAction extends ShownoticeAction throw new ServerException(_m('User without a profile.')); } - $this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE); + try { + $this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE); + } catch (Exception $e) { + $this->avatar = null; + } return true; }