Avoid null reference when trying to gather return value

This commit is contained in:
Pat Hartl 2024-09-27 17:59:47 -05:00
parent 45990ad477
commit 6b68592b71

View file

@ -217,7 +217,9 @@ namespace LANCommander.SDK.PowerShell
try
{
result = (T)ps.Runspace.SessionStateProxy.PSVariable.GetValue("Return");
var returnValue = ps.Runspace.SessionStateProxy.PSVariable.GetValue("Return");
result = (T)returnValue;
}
catch
{