diff --git a/src/main.cpp b/src/main.cpp index f4e0090..b3f1680 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -150,8 +150,11 @@ int main(int argc, char *argv[]) { auto matches{ search::search(filepath, regex, search_settings)}; - std::lock_guard guard(mutex_matches_all); - matches_all.emplace_back(matches); + if (!matches.empty()) + { + std::lock_guard guard(mutex_matches_all); + matches_all.emplace_back(matches); + } } catch (const zip::exception &e) {