From 221c355f15c63a0ea894f149015d81fe0c7d8905 Mon Sep 17 00:00:00 2001 From: Alessandro Toia Date: Wed, 18 Nov 2020 17:05:14 -0800 Subject: [PATCH] Check if item exits before adding to blacklist --- src/blacklist.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/blacklist.cpp b/src/blacklist.cpp index 378d6fcd..041d0aa3 100644 --- a/src/blacklist.cpp +++ b/src/blacklist.cpp @@ -62,7 +62,13 @@ bool is_blacklisted(bool force_recheck) { } void add_blacklist(std::string new_item) { + // check if item exits in blacklist before adding new item + if(std::find(blacklist.begin(), blacklist.end(), new_item) != blacklist.end()) { + return; + } + blacklist.push_back (new_item); is_blacklisted(true); } +