Browse Source

Fixed ArgumentNullException in CompileModifiedProjectsOnly when an IBuildable2 implementation returned null as ProjectBuildOptions.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4190 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 16 years ago
parent
commit
997b727c17
  1. 7
      src/Main/Base/Project/Src/Services/ProjectService/CompileModifiedProjectsOnly.cs

7
src/Main/Base/Project/Src/Services/ProjectService/CompileModifiedProjectsOnly.cs

@ -214,6 +214,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -214,6 +214,7 @@ namespace ICSharpCode.SharpDevelop.Project
}
Dictionary<ProjectBuildOptions, ICollection<IBuildable>> cachedBuildDependencies = new Dictionary<ProjectBuildOptions, ICollection<IBuildable>>();
ICollection<IBuildable> cachedBuildDependenciesForNullOptions;
public ICollection<IBuildable> GetBuildDependencies(ProjectBuildOptions buildOptions)
{
@ -222,7 +223,10 @@ namespace ICSharpCode.SharpDevelop.Project @@ -222,7 +223,10 @@ namespace ICSharpCode.SharpDevelop.Project
result.Add(factory.GetWrapper(b));
}
lock (cachedBuildDependencies) {
if (buildOptions != null)
cachedBuildDependencies[buildOptions] = result;
else
cachedBuildDependenciesForNullOptions = result;
}
return result;
}
@ -254,7 +258,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -254,7 +258,8 @@ namespace ICSharpCode.SharpDevelop.Project
}
if (lastCompilationPass != null && Setting == BuildOnExecuteSetting.BuildModifiedAndDependent) {
lock (cachedBuildDependencies) {
if (cachedBuildDependencies[buildOptions].OfType<Wrapper>().Any(w=>w.WasRecompiledAfter(lastCompilationPass))) {
var dependencies = buildOptions != null ? cachedBuildDependencies[buildOptions] : cachedBuildDependenciesForNullOptions;
if (dependencies.OfType<Wrapper>().Any(w=>w.WasRecompiledAfter(lastCompilationPass))) {
lastCompilationPass = null;
}
}

Loading…
Cancel
Save