mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
Fix: Do not crash if plugin folder mismatches plugin identifier
This commit is contained in:
@@ -83,13 +83,20 @@ namespace BTCPayServer.Plugins
|
|||||||
foreach (var dir in orderedDirs)
|
foreach (var dir in orderedDirs)
|
||||||
{
|
{
|
||||||
var pluginName = Path.GetFileName(dir);
|
var pluginName = Path.GetFileName(dir);
|
||||||
|
var pluginFilePath = Path.Combine(dir, pluginName + ".dll");
|
||||||
if (disabledPlugins.Contains(pluginName))
|
if (disabledPlugins.Contains(pluginName))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!File.Exists(pluginFilePath))
|
||||||
|
{
|
||||||
|
_logger.LogError(
|
||||||
|
$"Error when loading plugin {pluginName} - {pluginFilePath} does not exist");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
var plugin = PluginLoader.CreateFromAssemblyFile(
|
var plugin = PluginLoader.CreateFromAssemblyFile(
|
||||||
Path.Combine(dir, pluginName + ".dll"), // create a plugin from for the .dll file
|
pluginFilePath, // create a plugin from for the .dll file
|
||||||
config =>
|
config =>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user