diff options
author | Mike Krüger <mkrueger@novell.com> | 2010-11-09 12:25:46 +0300 |
---|---|---|
committer | Mike Krüger <mkrueger@novell.com> | 2010-11-09 12:25:46 +0300 |
commit | c3b2c39e962e751b0103fcaab4e7b36c49666499 (patch) | |
tree | aae54d6f9f28313a4eff50630f156ba87e55f051 /main | |
parent | 85cad58ab6be2dda363de48fe593ffa34050b712 (diff) |
Fixed possible null reference exception.
Diffstat (limited to 'main')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs index c2abd77b82..8573b6c16c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs @@ -117,7 +117,7 @@ namespace MonoDevelop.Ide.CodeTemplates ITextEditorResolver textEditorResolver = CurrentContext.Document.GetContent <ITextEditorResolver> (); if (textEditorResolver != null) { ResolveResult result = textEditorResolver.GetLanguageItem (CurrentContext.Document.Editor.Document.LocationToOffset (CurrentContext.InsertPosition.Line, CurrentContext.InsertPosition.Column), var); - if (result != null && (result.ResolvedType.ArrayDimensions > 0 || result.ResolvedType.FullName == DomReturnType.String.FullName)) + if (result != null && result.ResolvedType != null && (result.ResolvedType.ArrayDimensions > 0 || result.ResolvedType.FullName == DomReturnType.String.FullName)) return "Length"; } return "Count"; @@ -233,7 +233,7 @@ namespace MonoDevelop.Ide.CodeTemplates case "GetSimpleTypeName": return new CodeTemplateListDataProvider (GetSimpleTypeName (match.Groups[2].Value.Trim ('"'))); case "GetLengthProperty": - return new CodeTemplateListDataProvider (GetLengthProperty (callback, match.Groups[2].Value.Trim ('"'))); + return new CodeTemplateListDataProvider (GetLengthProperty (callback, match.Groups == null || match.Groups.Count < 3 ? null : match.Groups[2].Value.Trim ('"'))); case "GetComponentTypeOf": return new CodeTemplateListDataProvider (GetComponentTypeOf (callback, match.Groups[2].Value.Trim ('"'))); } |