Skip to content

Commit b3fee8e

Browse files
author
zhourenjian
committed
Fixing NPE bug
1 parent 92df85e commit b3fee8e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

sources/net.sf.j2s.ajax/ajaxpipe/net/sf/j2s/ajax/SimplePipeHelper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,12 @@ static boolean notifyPipeStatus(String key, boolean live) {
228228
* Wait some more seconds to check whether the pipe is to be closed or not.
229229
* @param runnable
230230
* @return whether the pipe is to be closed or not.
231+
* @j2sIgnore
231232
*/
232233
static boolean waitAMomentForClosing(final SimplePipeRunnable runnable) {
234+
if (runnable == null) {
235+
return true;
236+
}
233237
long extra = runnable.pipeWaitClosingInterval();
234238
long interval = runnable.pipeMonitoringInterval();
235239
if (interval <= 0) {

sources/net.sf.j2s.ajax/ajaxpipe/net/sf/j2s/ajax/SimplePipeHttpServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ protected void doPipe(final HttpServletResponse resp, String key, String type)
156156
}
157157
int size = vector.size();
158158
if (size > 0) {
159-
for (int i = size - 1; i >= 0; i--) {
159+
for (int i = 0; i < size; i++) {
160160
SimpleSerializable ss = null;
161161
/*
162162
* Still need to check vector size!

0 commit comments

Comments
 (0)