Fixed index out of bounds on data feed configs (#389)

This commit is contained in:
Ryan Butler authored and GitHub committed 2022-12-16 16:24:01 +03:00
1 parent fbf509ec79
commit 3dd94b3aa3
2 files changed
+6 -2

No files matched your search

@@ -18,7 +18,6 @@ public class ConnectionContext {
private final List<Integer> subscribedTopics = new ArrayList<>();
private boolean useSerial = false;
private boolean useAutoBone = false;
@@ -30,6 +29,11 @@ public class ConnectionContext {
return dataFeedTimers;
}
public void clearDataFeeds() {
this.dataFeedConfigList.clear();
this.dataFeedTimers.clear();
}
public List<Integer> getSubscribedTopics() {
return subscribedTopics;
}
@@ -31,7 +31,7 @@ public class DataFeedHandler extends ProtocolHandler<DataFeedMessageHeader> {
return;
int dataFeeds = req.dataFeedsLength();
conn.getContext().getDataFeedConfigList().clear();
conn.getContext().clearDataFeeds();
for (int i = 0; i < dataFeeds; i++) {
// Using the object api here because we need to copy from the buffer
// anyway so