Fixed the null ref exception #1460

pull/1648/head^2
tidusjar 7 years ago
parent 5342746d52
commit 016c409ace

@ -233,7 +233,7 @@ namespace Ombi.Schedule.Jobs.Ombi
private void RunScript(UpdateSettings settings, string downloadUrl) private void RunScript(UpdateSettings settings, string downloadUrl)
{ {
var scriptToRun = settings.ScriptLocation; var scriptToRun = settings?.ScriptLocation ?? string.Empty;
if (scriptToRun.IsNullOrEmpty()) if (scriptToRun.IsNullOrEmpty())
{ {
Logger.LogError("Use Script is enabled but there is no script to run"); Logger.LogError("Use Script is enabled but there is no script to run");
@ -245,10 +245,8 @@ namespace Ombi.Schedule.Jobs.Ombi
Logger.LogError("Cannot find the file {0}", scriptToRun); Logger.LogError("Cannot find the file {0}", scriptToRun);
return; return;
} }
var ombiProcess = _processProvider.FindProcessByName(settings.ProcessName).FirstOrDefault(); _processProvider.Start(scriptToRun, downloadUrl + " " + GetArgs(settings));
var currentInstallLocation = Assembly.GetEntryAssembly().Location;
_processProvider.Start(scriptToRun, downloadUrl + " " + ombiProcess.Id + " " + GetArgs(settings));
Logger.LogInformation("Script started"); Logger.LogInformation("Script started");
} }

Loading…
Cancel
Save