--- a/tool/src/www/WebRequest.java
+++ b/tool/src/www/WebRequest.java
@@ -34,6 +34,9 @@
// the set of parameters in key/value style
public ArrayList<String[]> parameters = new ArrayList<String[]>();
+ // what we reply when there is no answer?
+ private final String noAnswerReply = "No answer";
+
// helps to know if this request has already been handled or not
private boolean
wasAnswered = false;
@@ -115,8 +118,13 @@
public String getAnswer() {
+ if(answer == null){
+ setAnswer(noAnswerReply);
+ return answer;
+ }
+
if(answer.isEmpty()){
- setAnswer("No answer");
+ setAnswer(noAnswerReply);
}
return answer;
}