From d5386aa958876c3fc26bedbf14322d5fbe59889a Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 16 Jan 2020 02:16:35 +0300 Subject: [PATCH] Check presence in sync_to_repeat --- blockstore_flush.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blockstore_flush.cpp b/blockstore_flush.cpp index 2093a8c2..d278c43c 100644 --- a/blockstore_flush.cpp +++ b/blockstore_flush.cpp @@ -201,7 +201,7 @@ resume_1: // Nothing to flush flusher->active_flushers--; repeat_it = flusher->sync_to_repeat.find(cur.oid); - if (repeat_it->second > cur.version) + if (repeat_it != flusher->sync_to_repeat.end() && repeat_it->second > cur.version) { // Requeue version flusher->unshift_flush({ .oid = cur.oid, .version = repeat_it->second }); @@ -420,7 +420,7 @@ resume_1: #endif flusher->active_flushers--; repeat_it = flusher->sync_to_repeat.find(cur.oid); - if (repeat_it->second > cur.version) + if (repeat_it != flusher->sync_to_repeat.end() && repeat_it->second > cur.version) { // Requeue version flusher->unshift_flush({ .oid = cur.oid, .version = repeat_it->second });