Skip to content
Snippets Groups Projects
Commit 8e934200 authored by Gregor Maier's avatar Gregor Maier
Browse files

Fix NPE when switch doesn't have channel

parent 71f56ccf
No related branches found
No related tags found
No related merge requests found
......@@ -146,7 +146,7 @@ public abstract class OFSwitchBase implements IOFSwitch {
};
public static final int OFSWITCH_APP_ID = 5;
public OFSwitchBase() {
this.stringId = null;
this.attributes = new ConcurrentHashMap<Object, Object>();
......@@ -707,6 +707,8 @@ public abstract class OFSwitchBase implements IOFSwitch {
@Override
@JsonSerialize(using=ToStringSerializer.class)
public SocketAddress getInetAddress() {
if (channel == null)
return null;
return channel.getRemoteAddress();
}
......
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