Skip to content

Commit

Permalink
add conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
edkazcarlson-ms committed Oct 26, 2023
1 parent 735dc06 commit 3f0657f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Sarif.Viewer.VisualStudio.Core/ErrorList/ColumnFilterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ private IWpfTableControl ErrorListTableControl
{
get
{
ThreadHelper.ThrowIfNotOnUIThread();
if (!SarifViewerPackage.IsUnitTesting)
{
#pragma warning disable VSTHRD108 // Assert thread affinity unconditionally
ThreadHelper.ThrowIfNotOnUIThread();
#pragma warning restore VSTHRD108
}

if (this.errorListTableControl == null)
{
Expand All @@ -42,7 +47,12 @@ private IWpfTableControl ErrorListTableControl

public void FilterOut(string columnName, string filteredValue)
{
ThreadHelper.ThrowIfNotOnUIThread();
if (!SarifViewerPackage.IsUnitTesting)
{
#pragma warning disable VSTHRD108 // Assert thread affinity unconditionally
ThreadHelper.ThrowIfNotOnUIThread();
#pragma warning restore VSTHRD108
}

var filteredColumnValue = new FilteredColumnValue(columnName, filteredValue);
if (!this.filteredColumnValues.Contains(filteredColumnValue))
Expand Down

0 comments on commit 3f0657f

Please sign in to comment.