summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@opera.com>2023-07-18 15:21:47 +0200
committerJoel Klinghed <the_jk@opera.com>2023-07-18 15:21:47 +0200
commit56db18175d8a216bfed6200146125a1f90e3cbf1 (patch)
tree4285c8da6f85d3ac20786c2535fb3f78126cdf24
parent8e3d4426dc78549c329833fc9a3885e271ced14b (diff)
Avoid trying to add data to an unknown package idHEADmaster
Can happen when you connect to an already running proxy, as the proxy might send you data updates for packages that you haven't received.
-rw-r--r--src/monitor-gui.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/monitor-gui.cc b/src/monitor-gui.cc
index c4152b0..fdfbe80 100644
--- a/src/monitor-gui.cc
+++ b/src/monitor-gui.cc
@@ -1244,6 +1244,8 @@ public:
struct timespec timestamp) override {
assert(monitor == monitor_.get());
auto index = packages_->package_data(id, data, size, last, timestamp);
+ if (index == std::string::npos)
+ return;
auto const& pkg = packages_->package(index);
protocols_->update(index, pkg.data.data(), pkg.data.size());
if (has_selection_ && index == selection_) {