mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
Fixed possible NPE between callbacks (as client and server are not synchronized between calls)
This commit is contained in:
parent
2977afea2d
commit
c7ae032d5a
2 changed files with 8 additions and 2 deletions
|
@ -64,7 +64,9 @@ public class CallbackClientDaemon extends Thread {
|
|||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
client.processCallback(callback);
|
||||
if (callback != null) {
|
||||
client.processCallback(callback);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
logger.fatal("CallbackClientDaemon error ", ex);
|
||||
|
|
|
@ -101,7 +101,11 @@ public class ServerImpl extends RemoteServer implements Server {
|
|||
|
||||
@Override
|
||||
public ClientCallback callback(UUID sessionId) {
|
||||
return SessionManager.getInstance().getSession(sessionId).callback();
|
||||
Session session = SessionManager.getInstance().getSession(sessionId);
|
||||
if (session == null) {
|
||||
return null;
|
||||
}
|
||||
return session.callback();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue