Skip to content

Commit 8226af9

Browse files
authored
Merge pull request dotnet#6982 from drewnoakes/fix-nullable-field-access
Fix nullable field access
2 parents 2ccf625 + 399bdb2 commit 8226af9

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/TempPE/DesignTimeInputsChangeTracker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ void AddAllInputsToQueue(bool ignoreFileWriteTime)
229229
private void PublishSnapshot(DesignTimeInputSnapshot snapshot)
230230
{
231231
_version++;
232-
_broadcastBlock.Post(new ProjectVersionedValue<DesignTimeInputSnapshot>(
232+
_broadcastBlock?.Post(new ProjectVersionedValue<DesignTimeInputSnapshot>(
233233
snapshot,
234234
Empty.ProjectValueVersions.Add(DataSourceKey, _version)));
235235
}

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/TempPE/DesignTimeInputsFileWatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private async Task ProcessDesignTimeInputs(IProjectVersionedValue<DesignTimeInpu
131131
private void PublishFiles(string[] files)
132132
{
133133
_version++;
134-
_broadcastBlock.Post(new ProjectVersionedValue<string[]>(
134+
_broadcastBlock?.Post(new ProjectVersionedValue<string[]>(
135135
files,
136136
Empty.ProjectValueVersions.Add(DataSourceKey, _version)));
137137
}

src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/IProjectTreeExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ internal static class IProjectTreeExtensions
5151

5252
IRule? properties = node.BrowseObjectProperties;
5353

54-
if (properties == null || properties.Schema == null || !project.Services.PropertyPagesCatalog.SourceBlock.TryReceive(null, out IProjectVersionedValue<IProjectCatalogSnapshot> catalogSnapshot))
54+
if (properties?.Schema == null || !project.Services.PropertyPagesCatalog.SourceBlock.TryReceive(null, out IProjectVersionedValue<IProjectCatalogSnapshot>? catalogSnapshot))
5555
return properties;
5656

5757
// We let the snapshot be out of date with the "live" project

tests/Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests/Mocks/ProjectValueDataSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public async Task SendAsync(T value)
5959
EnsureInitialized(true);
6060

6161
_version++;
62-
await _broadcastBlock.SendAsync(new ProjectVersionedValue<T>(
62+
await _broadcastBlock!.SendAsync(new ProjectVersionedValue<T>(
6363
value,
6464
ImmutableDictionary<NamedIdentity, IComparable>.Empty.Add(DataSourceKey, _version)));
6565
}

0 commit comments

Comments
 (0)