Browse Source

Add workaround for ArgumentNullException in FormsDesignerViewContent.ShowSourceCode.

pull/2/head
Daniel Grunwald 15 years ago
parent
commit
45d3a71730
  1. 6
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/EventBindingService.cs

6
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/EventBindingService.cs

@ -72,7 +72,11 @@ namespace ICSharpCode.FormsDesigner.Services @@ -72,7 +72,11 @@ namespace ICSharpCode.FormsDesigner.Services
protected override bool ShowCode(IComponent component, EventDescriptor edesc, string methodName)
{
if (formDesigner != null) {
// There were reports of an ArgumentNullException caused by edesc==null.
// Looking at the .NET code calling this method, this can happen when there are two calls to ShowCode() before the Application.Idle
// event gets raised. In that case, ShowCode() already was called for the second set of arguments, and we can safely ignore
// the call with edesc==null.
if (formDesigner != null && edesc != null) {
formDesigner.ShowSourceCode(component, edesc, methodName);
return true;
}

Loading…
Cancel
Save