Skip to content

Commit 93162be

Browse files
author
Jianghao Lu
committed
Merge pull request Azure#875 from xindzhan/ai
Fix storage test for QosEvent writeError
2 parents 0330b5f + 2059005 commit 93162be

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Common/Commands.Common/AzurePSCmdlet.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,13 @@ protected bool IsVerbose()
407407
public new void WriteError(ErrorRecord errorRecord)
408408
{
409409
FlushDebugMessages();
410-
QosEvent.Exception = errorRecord.Exception;
411-
QosEvent.IsSuccess = false;
412-
LogQosEvent(true);
410+
if (QosEvent != null && errorRecord != null)
411+
{
412+
QosEvent.Exception = errorRecord.Exception;
413+
QosEvent.IsSuccess = false;
414+
LogQosEvent(true);
415+
}
416+
413417
base.WriteError(errorRecord);
414418
}
415419

0 commit comments

Comments
 (0)