Browse Source

Handle ObjectDisposedException in VBNetCompilationUnit.get_OptionInfer

4.1
Daniel Grunwald 14 years ago
parent
commit
3a6ef5746a
  1. 9
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/Project/VBNetProject.cs

9
src/AddIns/BackendBindings/VBNetBinding/Project/Src/Project/VBNetProject.cs

@ -172,7 +172,14 @@ namespace ICSharpCode.VBNetBinding @@ -172,7 +172,14 @@ namespace ICSharpCode.VBNetBinding
bool? GetValue(string name, bool defaultVal)
{
string val = GetEvaluatedProperty(name);
string val;
try {
val = GetEvaluatedProperty(name);
} catch (ObjectDisposedException) {
// This can happen when the project is disposed but the resolver still tries
// to access Option Infer (or similar).
val = null;
}
if (val == null)
return defaultVal;

Loading…
Cancel
Save