[grid] Fixing possible NPE: the fact that slot.isAvailable() returns false does not imply there is a session, the slot can be reserved but the session is not ready yet.
@@ -470,6 +470,7 @@ public NodeStatus getStatus() {
Optional<Session> session = Optional.empty();
if (!slot.isAvailable()) {
ActiveSession activeSession = slot.getSession();
+ if (activeSession != null) {
session = Optional.of(
new Session(
activeSession.getId(),
@@ -478,6 +479,7 @@ public NodeStatus getStatus() {
activeSession.getCapabilities(),
activeSession.getStartTime()));
}
+ }
return new Slot(
new SlotId(getId(), slot.getId()),
