File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,12 @@ class CommandsManager
2121 Command *FetchCommand (std::string cmd);
2222 bool RegisterCommand (std::string plugin_name, std::string cmd, Command *command);
2323 bool UnregisterCommand (std::string cmd);
24- std::vector<std::string> FetchCommandsByPlugin (std::string plugin_name) { return this ->commandsByPlugin .at (plugin_name); }
24+ std::vector<std::string> FetchCommandsByPlugin (std::string plugin_name)
25+ {
26+ if (this ->commandsByPlugin .find (plugin_name) == this ->commandsByPlugin .end ())
27+ return {};
28+ return this ->commandsByPlugin .at (plugin_name);
29+ }
2530
2631 std::map<std::string, Command *> GetCommands ()
2732 {
Original file line number Diff line number Diff line change @@ -48,9 +48,7 @@ void Plugin::StopPlugin()
4848{
4949 void *OnPluginStop = this ->FetchFunction (" Internal_OnPluginStop" );
5050 if (OnPluginStop)
51- {
5251 reinterpret_cast <OnPluginStopFunction>(OnPluginStop)();
53- }
5452
5553 dlclose (this ->m_hModule );
5654 this ->functions .clear ();
You can’t perform that action at this time.
0 commit comments