diff --git a/ChangeLog b/ChangeLog index 1f7ee52..0788eb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-03 Ivan N. Zlatev + + * CodeProvider.cs: Don't assume that all definitions will be method + definitions in the .Designer file. Fixes a NRE. + 2008-09-02 Ivan N. Zlatev * deps/Mono.Design/patches/DesignerHost-designer-type-replacement.patch, diff --git a/src/DesignTime/CodeProvider.cs b/src/DesignTime/CodeProvider.cs index 6cf77da..6fd9a2b 100644 --- a/src/DesignTime/CodeProvider.cs +++ b/src/DesignTime/CodeProvider.cs @@ -314,7 +314,7 @@ private TypeDeclaration GetFirstValidType (CompilationUnit document) if (declaration != null) { foreach (INode child2 in declaration.Children) { MethodDeclaration methodDecl = child2 as MethodDeclaration; - if (methodDecl.Name == "InitializeComponent") + if (methodDecl != null && methodDecl.Name == "InitializeComponent") return declaration; } }