Avoid null reference when trying to gather return value
This commit is contained in:
parent
45990ad477
commit
6b68592b71
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue