X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=shared%2Fmetrics.cpp;h=248da38a277992289e9ae703bd1442f16ce077e5;hb=533f00a9b992d06767737f9db236b4cf76b9c124;hp=b2d0bbce5ca0671a3d810bf19c74cd7dda29f1ce;hpb=ed041ec8c0fa1dd31fd3c3ac053da13519c524c3;p=nageru diff --git a/shared/metrics.cpp b/shared/metrics.cpp index b2d0bbc..248da38 100644 --- a/shared/metrics.cpp +++ b/shared/metrics.cpp @@ -99,7 +99,7 @@ void Metrics::remove(const string &name, const vector> &lab // If this is the last metric with this name, remove the type as well. if (!((it != metrics.begin() && prev(it)->first.name == name) || - (it != metrics.end() && next(it)->first.name == name))) { + (it != metrics.end() && next(it) != metrics.end() && next(it)->first.name == name))) { types.erase(name); }