From dfee3547b7da859cb5f77fcaf3ffcbae6c4e85e1 Mon Sep 17 00:00:00 2001 From: Ivan Zlatev Date: Wed, 3 Sep 2008 11:04:07 +0000 Subject: [PATCH] 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. svn path=/trunk/mwf-designer/; revision=112167 --- ChangeLog | 5 +++++ src/DesignTime/CodeProvider.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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; } }