Do not throw when a plugin removal fails
Summary: Symmetry with D48642974. Changelog: Don't throw in C++ if a plugin gets added/removed multiple times. Reviewed By: lblasa Differential Revision: D48643116 fbshipit-source-id: cc6638061b1dee2a6f7deb1fab1093906decc24a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7822099f50
commit
2a6426ebbe
@@ -92,7 +92,8 @@ void FlipperClient::removePlugin(std::shared_ptr<FlipperPlugin> plugin) {
|
||||
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if (plugins_.find(plugin->identifier()) == plugins_.end()) {
|
||||
throw std::out_of_range("plugin " + plugin->identifier() + " not added.");
|
||||
log("plugin " + plugin->identifier() + " not added.");
|
||||
return;
|
||||
}
|
||||
disconnect(plugin);
|
||||
plugins_.erase(plugin->identifier());
|
||||
|
||||
Reference in New Issue
Block a user