forked from Qortal/qortal
Fix missing groupId 0 entry in output from API call GET /chat/active/{address}
This commit is contained in:
parent
f29ae656b9
commit
ef790a8cb1
@ -130,9 +130,7 @@ public class HSQLDBChatRepository implements ChatRepository {
|
|||||||
|
|
||||||
List<GroupChat> groupChats = new ArrayList<>();
|
List<GroupChat> groupChats = new ArrayList<>();
|
||||||
try (ResultSet resultSet = this.repository.checkedExecute(groupsSql, address)) {
|
try (ResultSet resultSet = this.repository.checkedExecute(groupsSql, address)) {
|
||||||
if (resultSet == null)
|
if (resultSet != null) {
|
||||||
return groupChats;
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
int groupId = resultSet.getInt(1);
|
int groupId = resultSet.getInt(1);
|
||||||
String groupName = resultSet.getString(2);
|
String groupName = resultSet.getString(2);
|
||||||
@ -141,6 +139,7 @@ public class HSQLDBChatRepository implements ChatRepository {
|
|||||||
GroupChat groupChat = new GroupChat(groupId, groupName, timestamp);
|
GroupChat groupChat = new GroupChat(groupId, groupName, timestamp);
|
||||||
groupChats.add(groupChat);
|
groupChats.add(groupChat);
|
||||||
} while (resultSet.next());
|
} while (resultSet.next());
|
||||||
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new DataException("Unable to fetch active group chats from repository", e);
|
throw new DataException("Unable to fetch active group chats from repository", e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user