Skip to content

Commit 54686fa

Browse files
committed
Add null check for exception
1 parent c6ced19 commit 54686fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Common/Commands.Common/AzurePSCmdlet.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,8 @@ public void Dispose()
700700

701701
public virtual bool IsTerminatingError(Exception ex)
702702
{
703-
if (ex is PipelineStoppedException && ex.InnerException == null)
703+
var pipelineStoppedEx = ex as PipelineStoppedException;
704+
if (pipelineStoppedEx != null && pipelineStoppedEx.InnerException == null)
704705
{
705706
return true;
706707
}

0 commit comments

Comments
 (0)