# HG changeset patch # User Alain Mazy # Date 1732003599 -3600 # Node ID 2701b450060c468875692680b76fd4f0b1649486 # Parent c8788f8f5322006e055ce56e7f71d3dc990dd1e8 fix failure when loading inexistent plugin diff -r c8788f8f5322 -r 2701b450060c OrthancServer/Plugins/Engine/PluginsManager.cpp --- a/OrthancServer/Plugins/Engine/PluginsManager.cpp Mon Nov 18 15:16:16 2024 +0100 +++ b/OrthancServer/Plugins/Engine/PluginsManager.cpp Tue Nov 19 09:06:39 2024 +0100 @@ -244,7 +244,21 @@ { if (!boost::filesystem::exists(path)) { - throw OrthancException(ErrorCode_SharedLibrary, "Inexistent path to plugin: " + path); + boost::filesystem::path p(path); + std::string extension = p.extension().string(); + Toolbox::ToLowerCase(extension); + + if (extension == PLUGIN_EXTENSION) + { + // if this is a plugin path, fail to start + throw OrthancException(ErrorCode_SharedLibrary, "Inexistent path to plugin: " + path); + } + else + { + // it might be a directory -> just log a warning + LOG(WARNING) << "Inexistent path to plugins: " << path; + return; + } } if (boost::filesystem::is_directory(path))