Skip to content

Commit

Permalink
Do not throw when a plugin removal fails
Browse files Browse the repository at this point in the history
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
  • Loading branch information
passy authored and facebook-github-bot committed Aug 25, 2023
1 parent 7822099 commit 2a6426e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xplat/Flipper/FlipperClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 2a6426e

Please sign in to comment.