Skip to content
Snippets Groups Projects
Commit a959637e authored by Paul-Christian Volkmer's avatar Paul-Christian Volkmer
Browse files

Return 0 if there are no questions (wich should never happen)

parent c8cf241c
Branches
Tags
No related merge requests found
...@@ -52,7 +52,10 @@ public class Statistics { ...@@ -52,7 +52,10 @@ public class Statistics {
} }
public int getAverageAnswersPerQuestion() { public int getAverageAnswersPerQuestion() {
return getAnswers() / getQuestions(); if (getQuestions() > 0) {
return getAnswers() / getQuestions();
}
return 0;
} }
public void setAverageAnswersPerQuestion(final int value) { public void setAverageAnswersPerQuestion(final int value) {
// NOP // NOP
......
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