Skip to content
Snippets Groups Projects
Commit 73e8266b authored by Andreas Wundsam's avatar Andreas Wundsam
Browse files

floodlight: statisticsmessagebase: fix possible NPE

parent 4f5e3187
No related branches found
No related tags found
No related merge requests found
......@@ -88,7 +88,10 @@ public abstract class OFStatisticsMessageBase extends OFMessage implements
* element
*/
public OFStatistics getFirstStatistics() {
if (statistics == null || statistics.size() != 1) {
if (statistics == null ) {
throw new IllegalArgumentException("Invariant violation: statistics message of type "+statisticType+" is null");
}
if (statistics.size() != 1) {
throw new IllegalArgumentException("Invariant violation: statistics message of type "+statisticType+" contains "+statistics.size() +" statreq/reply messages in its body (should be 1)");
}
......
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