From 9b330200f49659924724bfaa470894feaa58fc6b Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Tue, 2 Jan 2007 12:55:11 +0000 Subject: [PATCH] Fixed SD2-1257. Fixed a null reference exception in the AddComponentsDialog that could occur when listing the components from a file which is not a .NET assembly. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.1@2255 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs index 3f5055942a..92214ae6e5 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs @@ -68,7 +68,11 @@ namespace ICSharpCode.FormsDesigner.Gui { if (componentListView.Items.Count == 0) { if (componentListView.Controls.Count == 0) { - ClearComponentsList(StringParser.Parse("${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.AddSidebarComponents.NoComponentsFound}", new string[,] {{"Name", lastAssembly.FullName}})); + string name = String.Empty; + if (lastAssembly != null) { + name = lastAssembly.FullName; + } + ClearComponentsList(StringParser.Parse("${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.AddSidebarComponents.NoComponentsFound}", new string[,] {{"Name", name}})); } } componentListView.EndUpdate();