to avoid NPE
This commit is contained in:
parent
085161de17
commit
2117bd2b99
@ -32,10 +32,12 @@ public class ChargingPileEventHandler implements ClientEventHandler {
|
||||
public void lostConnection(ClientHandler handler) {
|
||||
|
||||
String pileNo = ChargingPileServer.getPileNo(handler);
|
||||
String pkey = "pile:".concat(pileNo);
|
||||
Map<String, Object> cachePile = REDIS.getCacheMap(pkey);
|
||||
cachePile.put("status", RegisterLogic.DISCONNECTED);
|
||||
REDIS.setCacheMap(pkey, cachePile);
|
||||
if (pileNo != null) {
|
||||
String pkey = "pile:".concat(pileNo);
|
||||
Map<String, Object> cachePile = REDIS.getCacheMap(pkey);
|
||||
cachePile.put("status", RegisterLogic.DISCONNECTED);
|
||||
REDIS.setCacheMap(pkey, cachePile);
|
||||
}
|
||||
log.info("-> ({}) - [{}] <- {}",
|
||||
pileNo, handler.getName(), handler.getSocket().getRemoteSocketAddress().toString());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user