From 0c18d6b4c220bdae932aaab82a713ec726aff512 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Wed, 8 May 2013 22:02:42 +0200 Subject: [PATCH] Fix NullReferenceException in SDWindowsFormsHost.GetInterface() --- src/Main/SharpDevelop/WinForms/SDWindowsFormsHost.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Main/SharpDevelop/WinForms/SDWindowsFormsHost.cs b/src/Main/SharpDevelop/WinForms/SDWindowsFormsHost.cs index 8a897eb811..64b6c7737d 100644 --- a/src/Main/SharpDevelop/WinForms/SDWindowsFormsHost.cs +++ b/src/Main/SharpDevelop/WinForms/SDWindowsFormsHost.cs @@ -94,7 +94,10 @@ namespace ICSharpCode.SharpDevelop.WinForms T GetInterface() where T : class { - T instance = this.ServiceProvider.GetService(); + T instance = null; + if (this.ServiceProvider != null) { + instance = this.ServiceProvider.GetService(); + } if (instance == null) { instance = GetServiceWrapper(GetActiveControl()) as T; }