From b67dfce2bb9cd91a13e5abffb2cb6f216e18d3c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kon=C3=AD=C4=8Dek?= Date: Thu, 22 Jul 2010 23:36:12 +0000 Subject: [PATCH] Fix recently introduced bug when opening files with other than C#/VB content. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6188 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../ContextActions/EditorASTProvider.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Main/Base/Project/Src/Services/RefactoringService/ContextActions/EditorASTProvider.cs b/src/Main/Base/Project/Src/Services/RefactoringService/ContextActions/EditorASTProvider.cs index 2881664ba7..d02d6e6641 100644 --- a/src/Main/Base/Project/Src/Services/RefactoringService/ContextActions/EditorASTProvider.cs +++ b/src/Main/Base/Project/Src/Services/RefactoringService/ContextActions/EditorASTProvider.cs @@ -84,7 +84,14 @@ namespace ICSharpCode.SharpDevelop.Refactoring { if (editor == null || editor.Language == null) return null; - return new NRefactoryResolver(editor.Language.Properties); + try + { + return new NRefactoryResolver(editor.Language.Properties); + } + catch(NotSupportedException) + { + return null; + } } SupportedLanguage? GetEditorLanguage(ITextEditor editor)