mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-05-08 13:46:10 +02:00
If modelObject is empty here, it may cause exception later.
Change-Id: I892fdde7dabbf9dc55a74a6722413e260d0eedae
This commit is contained in:
parent
7d82afc0ae
commit
b227781dea
@ -240,6 +240,9 @@ public abstract class TapiObjectHandler<T extends ModelObject> {
|
||||
if (modelObjectData.modelObjects().size() > 1) {
|
||||
throw new IllegalStateException("Multiple modelObject found.");
|
||||
}
|
||||
if (modelObjectData.modelObjects().isEmpty()) {
|
||||
throw new IllegalStateException("ModelObject must not be empty.");
|
||||
}
|
||||
return (T) modelObjectData.modelObjects().get(0);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user