Skip to content
Snippets Groups Projects
Commit 24d752a7 authored by Christoph Thelen's avatar Christoph Thelen
Browse files

Fixed NullPointerException if question does not exist

parent 3cf4e3be
No related merge requests found
...@@ -270,7 +270,9 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis ...@@ -270,7 +270,9 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis
@PreAuthorize("isAuthenticated()") @PreAuthorize("isAuthenticated()")
public int getAnswerCount(final String questionId) { public int getAnswerCount(final String questionId) {
final Question question = getQuestion(questionId); final Question question = getQuestion(questionId);
if (question == null) {
return 0;
}
return databaseDao.getAnswerCount(question, question.getPiRound()); return databaseDao.getAnswerCount(question, question.getPiRound());
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment