Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions VisualStudioAdapter/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace VisualStudioAdapter
/// </summary>
class Project
{
private EnvDTE.Project _project = null;
private readonly EnvDTE.Project _project;
private ProjectConfiguration _configuration = null;

/// <summary>
Expand Down Expand Up @@ -60,7 +60,7 @@ private VCConfiguration Configuration
if (vcProj != null)
{
var configs = vcProj.Configurations as IVCCollection;
if (configs != null)
if (configs != null && ActiveConfigurationName != null)
{
return configs.Item(ActiveConfigurationName) as VCConfiguration;
}
Expand All @@ -77,7 +77,8 @@ private string ActiveConfigurationName
{
get
{
return this._project.ConfigurationManager.ActiveConfiguration.ConfigurationName + "|" + this._project.ConfigurationManager.ActiveConfiguration.PlatformName;
var activeConfiguration = this._project.ConfigurationManager?.ActiveConfiguration;
return activeConfiguration == null ? null : (activeConfiguration.ConfigurationName + "|" + activeConfiguration.PlatformName);
}
}

Expand All @@ -90,4 +91,4 @@ public override string ToString()

#endregion Object Overrides
}
}
}