fix: null pointer exception
if argument is null in res.debug() / write() / writeln()
This commit is contained in:
parent
7185214a5d
commit
e82dd613db
1 changed files with 8 additions and 0 deletions
|
@ -204,6 +204,8 @@ public class ResponseBean implements Serializable {
|
||||||
* @param str the string to write to the response buffer
|
* @param str the string to write to the response buffer
|
||||||
*/
|
*/
|
||||||
public void write(String... str) {
|
public void write(String... str) {
|
||||||
|
if (str == null) return;
|
||||||
|
|
||||||
for (String s : str) {
|
for (String s : str) {
|
||||||
res.write(s);
|
res.write(s);
|
||||||
}
|
}
|
||||||
|
@ -215,6 +217,8 @@ public class ResponseBean implements Serializable {
|
||||||
* @param str the string to write to the response buffer
|
* @param str the string to write to the response buffer
|
||||||
*/
|
*/
|
||||||
public void writeln(String... str) {
|
public void writeln(String... str) {
|
||||||
|
if (str == null) return;
|
||||||
|
|
||||||
for (String s : str) {
|
for (String s : str) {
|
||||||
res.writeln(s);
|
res.writeln(s);
|
||||||
}
|
}
|
||||||
|
@ -242,6 +246,10 @@ public class ResponseBean implements Serializable {
|
||||||
* @param message the message
|
* @param message the message
|
||||||
*/
|
*/
|
||||||
public void debug(String... messages) {
|
public void debug(String... messages) {
|
||||||
|
if (messages == null) {
|
||||||
|
messages = new String[]{null};
|
||||||
|
}
|
||||||
|
|
||||||
for (String message : messages) {
|
for (String message : messages) {
|
||||||
res.debug(message);
|
res.debug(message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue