Skip to content

Commit

Permalink
Merge pull request #3847 from dibyang/raw_master
Browse files Browse the repository at this point in the history
Fix the NullPointerException caused by accessing 'user' after the ses…
  • Loading branch information
katzyn committed Jul 24, 2023
2 parents b251b85 + 574e511 commit 8e3d87d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion h2/src/main/org/h2/table/InformationSchemaTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -2847,11 +2847,16 @@ private void sessions(SessionLocal session, ArrayList<Row> rows, SessionLocal s)
NetworkConnectionInfo networkConnectionInfo = s.getNetworkConnectionInfo();
Command command = s.getCurrentCommand();
int blockingSessionId = s.getBlockingSessionId();
User user = s.getUser();
if (user == null) {
// Session was closed concurrently
return;
}
add(session, rows,
// SESSION_ID
ValueInteger.get(s.getId()),
// USER_NAME
s.getUser().getName(),
user.getName(),
// SERVER
networkConnectionInfo == null ? null : networkConnectionInfo.getServer(),
// CLIENT_ADDR
Expand Down

0 comments on commit 8e3d87d

Please sign in to comment.