Fix NRE in Test-Json (#12942)

This commit is contained in:
Ilya authored and GitHub committed 2020-10-27 13:54:52 -07:00
1 parent 191c00da17
commit dfc591c218
1 file changed
+1 -1
@@ -59,7 +59,7 @@ namespace Microsoft.PowerShell.Commands
/// <returns>Return value is unreachable since we always rethrow.</returns>
private static bool UnwrapException(Exception e)
{
if (e is TargetInvocationException)
if (e.InnerException != null && e is TargetInvocationException)
{
ExceptionDispatchInfo.Capture(e.InnerException).Throw();
}