fix: null pointer exception

if argument is null in res.debug() / write() / writeln()
This commit is contained in:
Tobi Schäfer 2017-04-17 15:32:12 +02:00
parent 00762cf495
commit 03e2718ff5

View file

@ -204,6 +204,8 @@ public class ResponseBean implements Serializable {
* @param str the string to write to the response buffer
*/
public void write(String... str) {
if (str == null) return;
for (String s : str) {
res.write(s);
}
@ -215,6 +217,8 @@ public class ResponseBean implements Serializable {
* @param str the string to write to the response buffer
*/
public void writeln(String... str) {
if (str == null) return;
for (String s : str) {
res.writeln(s);
}
@ -242,6 +246,10 @@ public class ResponseBean implements Serializable {
* @param message the message
*/
public void debug(String... messages) {
if (messages == null) {
messages = new String[]{null};
}
for (String message : messages) {
res.debug(message);
}