Commit 75936f70 authored by God Ly's avatar God Ly Committed by it2000

fix of NPE

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@11792 b35dd754-fafc-0310-a699-88a17e54d16e
parent 1afffa00
......@@ -124,13 +124,7 @@ public class DefaultSecurityAuditProvider implements SecurityAuditProvider {
try {
con = DbConnectionManager.getConnection();
pstmt = DbConnectionManager.createScrollablePreparedStatement(con, sql);
rs = pstmt.executeQuery();
if (skipEvents != null) {
DbConnectionManager.scrollResultSet(rs, skipEvents);
}
if (numEvents != null) {
DbConnectionManager.setFetchSize(rs, numEvents);
}
int i = 1;
if (username != null) {
pstmt.setString(i, username);
......@@ -143,6 +137,15 @@ public class DefaultSecurityAuditProvider implements SecurityAuditProvider {
if (endTime != null) {
pstmt.setLong(i, endTime.getTime());
}
rs = pstmt.executeQuery();
if (skipEvents != null) {
DbConnectionManager.scrollResultSet(rs, skipEvents);
}
if (numEvents != null) {
DbConnectionManager.setFetchSize(rs, numEvents);
}
int count = 0;
while (rs.next() && count < numEvents) {
SecurityAuditEvent event = new SecurityAuditEvent();
......
Markdown is supported
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