fixed fatal error when a QnA question is deleted but its notice still exists

This commit is contained in:
Florian Hülsmann 2012-07-26 13:10:20 +02:00
parent 3ad77e8bb2
commit 9f91cc01de
1 changed files with 1 additions and 1 deletions

View File

@ -436,7 +436,7 @@ class QnAPlugin extends MicroAppPlugin
$user = common_current_user();
$question = QnA_Question::getByNotice($notice);
if (!empty($user)) {
if (!empty($user) and !empty($question)) {
$profile = $user->getProfile();
$answer = $question->getAnswer($profile);