diff options
author | Alan McGovern <alan@xamarin.com> | 2014-03-12 19:07:30 +0400 |
---|---|---|
committer | Alan McGovern <alan@xamarin.com> | 2014-03-12 19:07:30 +0400 |
commit | 570e0825e1009c780f209bd24178de1ec09d912d (patch) | |
tree | a0ba27b9fa4eed3c606022db850cc46714cae04c /main/src/core/MonoDevelop.Core | |
parent | e21310406f17550870dfb1a4936f226e03d56d9a (diff) |
[Core] Fix a null reference exception handling MSBuild errors
It is common for the 'File' property to be null, so don't try
to use it when it's null.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=18309
Diffstat (limited to 'main/src/core/MonoDevelop.Core')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs index 12f10b38a4..48401d730d 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs @@ -261,7 +261,9 @@ namespace MonoDevelop.Projects.Formats.MSBuild var br = new BuildResult (); foreach (MSBuildResult res in results) { - FilePath file = Path.Combine (Path.GetDirectoryName (res.ProjectFile), res.File); + FilePath file = null; + if (res.File != null) + file = Path.Combine (Path.GetDirectoryName (res.ProjectFile), res.File); if (res.IsWarning) br.AddWarning (file, res.LineNumber, res.ColumnNumber, res.Code, res.Message); |