Skip to content

Commit

Permalink
Adding nullcheck for process
Browse files Browse the repository at this point in the history
  • Loading branch information
IsakNaslundBh committed Sep 8, 2021
1 parent 0c9ec27 commit cedef65
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion GSA_Adapter/AdapterActions/Execute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,12 @@ public bool RunCommand(Exit command)
}

using (System.Diagnostics.Process gsaProcess = System.Diagnostics.Process.GetProcessById(m_gsaCom.ProcessID()))
{
{
if (gsaProcess == null)
{
Engine.Reflection.Compute.RecordError("Could not find GSA process. Unable to exit application,");
return false;
}
string name = gsaProcess.ProcessName;
if (!name.ToUpper().Contains("GSA"))
{
Expand Down

0 comments on commit cedef65

Please sign in to comment.