Fix to return empty list not null if there is no rows in Controller table
Change-Id: If1ff8c229cfafdd25c5cef4029c6f31dc5cfb6d8
diff --git a/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/DefaultOvsdbClient.java b/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/DefaultOvsdbClient.java
index 2575a25..3280ad3 100644
--- a/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/DefaultOvsdbClient.java
+++ b/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/DefaultOvsdbClient.java
@@ -175,14 +175,19 @@
*
* @param dbName the ovsdb database name
* @param tableName the ovsdb table name
- * @return ovsRowStore, empty if row store is find
+ * @return ovsRowStore, empty store if no rows exist in the table
*/
private OvsdbRowStore getRowStore(String dbName, String tableName) {
OvsdbTableStore tableStore = getTableStore(dbName);
if (tableStore == null) {
return null;
}
- return tableStore.getRows(tableName);
+
+ OvsdbRowStore rowStore = tableStore.getRows(tableName);
+ if (rowStore == null) {
+ rowStore = new OvsdbRowStore();
+ }
+ return rowStore;
}
/**