Skip to content
Snippets Groups Projects
Commit cf2707d9 authored by Ryan Izard's avatar Ryan Izard
Browse files

Merge pull request #654 from rizard/master

Need to check for empty Optional instead of null
parents e61a8f61 38512ad1
No related branches found
No related tags found
No related merge requests found
......@@ -984,11 +984,11 @@ public class OFSwitchHandshakeHandler implements IOFConnectionListener {
*/
if (m.getErrType() == OFErrorType.BAD_REQUEST &&
((OFBadRequestErrorMsg) m).getCode() == OFBadRequestCode.BAD_TYPE) {
if (((OFBadRequestErrorMsg) m).getData().getParsedMessage() != null &&
if (((OFBadRequestErrorMsg) m).getData().getParsedMessage().isPresent() &&
((OFBadRequestErrorMsg) m).getData().getParsedMessage().get() instanceof OFBarrierRequest) {
log.warn("Switch does not support Barrier Request messages. Could be an HP ProCurve.");
} else if (((OFBadRequestErrorMsg) m).getData().getParsedMessage() == null) {
log.warn("Switch may not support Barrier Request messages (we can't know for sure if it's a barrier or not). Could be an Brocade...");
} else if (!((OFBadRequestErrorMsg) m).getData().getParsedMessage().isPresent()) {
log.warn("Switch may not support Barrier Request messages (we can't know for sure if it's a barrier or not). Could be a Brocade...");
}
} else {
logErrorDisconnect(m);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment