mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-22 22:34:53 -04:00
Fixed: Unable to execute custom scripts if IMDB ID is null (#2543)
fixes #1460
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
@@ -98,9 +98,9 @@ namespace NzbDrone.Common.Processes
|
||||
var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo(url)
|
||||
{
|
||||
UseShellExecute = true
|
||||
}
|
||||
{
|
||||
UseShellExecute = true
|
||||
}
|
||||
};
|
||||
|
||||
process.Start();
|
||||
@@ -129,16 +129,34 @@ namespace NzbDrone.Common.Processes
|
||||
{
|
||||
foreach (DictionaryEntry environmentVariable in environmentVariables)
|
||||
{
|
||||
startInfo.EnvironmentVariables.Add(environmentVariable.Key.ToString(), environmentVariable.Value.ToString());
|
||||
try
|
||||
{
|
||||
_logger.Trace("Setting environment variable '{0}' to '{1}'", environmentVariable.Key, environmentVariable.Value);
|
||||
startInfo.EnvironmentVariables.Add(environmentVariable.Key.ToString(), environmentVariable.Value.ToString());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (environmentVariable.Value == null)
|
||||
{
|
||||
_logger.Error(e, "Unable to set environment variable '{0}', value is null", environmentVariable.Key);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
_logger.Error(e, "Unable to set environment variable '{0}'", environmentVariable.Key);
|
||||
}
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
logger.Debug("Starting {0} {1}", path, args);
|
||||
|
||||
var process = new Process
|
||||
{
|
||||
StartInfo = startInfo
|
||||
};
|
||||
{
|
||||
StartInfo = startInfo
|
||||
};
|
||||
|
||||
process.OutputDataReceived += (sender, eventArgs) =>
|
||||
{
|
||||
@@ -315,7 +333,7 @@ namespace NzbDrone.Common.Processes
|
||||
|
||||
var monoProcesses = Process.GetProcessesByName("mono")
|
||||
.Union(Process.GetProcessesByName("mono-sgen"))
|
||||
.Union(Process.GetProcessesByName("mono-sgen32"))
|
||||
.Union(Process.GetProcessesByName("mono-sgen32"))
|
||||
.Where(process =>
|
||||
process.Modules.Cast<ProcessModule>()
|
||||
.Any(module =>
|
||||
|
||||
Reference in New Issue
Block a user