diff --git a/src/main/java/com/Acrobot/Breeze/Database/RowSet.java b/src/main/java/com/Acrobot/Breeze/Database/RowSet.java index 215d403d..217a1b3f 100644 --- a/src/main/java/com/Acrobot/Breeze/Database/RowSet.java +++ b/src/main/java/com/Acrobot/Breeze/Database/RowSet.java @@ -36,4 +36,13 @@ public class RowSet { public int size() { return rowList.size(); } + + /** + * Returns if the RowSet is empty + * + * @return Is the RowSet empty? + */ + public boolean isEmpty() { + return size() == 0; + } } \ No newline at end of file diff --git a/src/main/java/com/Acrobot/Breeze/Database/Table.java b/src/main/java/com/Acrobot/Breeze/Database/Table.java index 47badd6c..5e6c04b6 100644 --- a/src/main/java/com/Acrobot/Breeze/Database/Table.java +++ b/src/main/java/com/Acrobot/Breeze/Database/Table.java @@ -84,7 +84,7 @@ public class Table { */ public Row getRow(String criteria) throws SQLException { RowSet rs = select(criteria); - return (rs.size() > 0 ? rs.get(0) : new Row()); + return (!rs.isEmpty() ? rs.get(0) : new Row()); } /**