Browse Source

Fix missing groupId 0 entry in output from API call GET /chat/active/{address}

pull/67/head
catbref 4 years ago
parent
commit
ef790a8cb1
  1. 5
      src/main/java/org/qortal/repository/hsqldb/HSQLDBChatRepository.java

5
src/main/java/org/qortal/repository/hsqldb/HSQLDBChatRepository.java

@ -130,9 +130,7 @@ public class HSQLDBChatRepository implements ChatRepository {
List<GroupChat> groupChats = new ArrayList<>();
try (ResultSet resultSet = this.repository.checkedExecute(groupsSql, address)) {
if (resultSet == null)
return groupChats;
if (resultSet != null) {
do {
int groupId = resultSet.getInt(1);
String groupName = resultSet.getString(2);
@ -141,6 +139,7 @@ public class HSQLDBChatRepository implements ChatRepository {
GroupChat groupChat = new GroupChat(groupId, groupName, timestamp);
groupChats.add(groupChat);
} while (resultSet.next());
}
} catch (SQLException e) {
throw new DataException("Unable to fetch active group chats from repository", e);
}

Loading…
Cancel
Save