SONAR suggestion - possible NPE if date is not set

Change-Id: I35a58ad7a5f82250fa56f49cdca4a22b437ea202
This commit is contained in:
Ray Milkey 2018-01-19 09:59:16 -08:00
parent fe0e085ed2
commit 7b332f168f

View File

@ -485,9 +485,8 @@ class PcepChannelHandler extends IdleStateAwareChannelHandler {
* @throws PcepParseException while building pcep error message
*/
public void processUnknownMsg() throws PcepParseException {
Date now = null;
Date now = new Date();
if (pcepPacketStats.wrongPacketCount() == 0) {
now = new Date();
pcepPacketStats.setTime(now.getTime());
pcepPacketStats.addWrongPacket();
sendErrMsgForInvalidMsg();