From 8502d5f2b278f8337d43d492eef7b0c9d53ade5a Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Fri, 30 Jan 2009 18:30:21 +0100 Subject: [PATCH] Avoid exception in key handling routine --- src/MacVim/MMTextViewHelper.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MacVim/MMTextViewHelper.m b/src/MacVim/MMTextViewHelper.m index 27ec250364..d1a1bbfeaf 100644 --- a/src/MacVim/MMTextViewHelper.m +++ b/src/MacVim/MMTextViewHelper.m @@ -747,7 +747,7 @@ static float MMDragAreaSize = 73.0f; NSString *chars = [event characters]; NSString *unmodchars = [event charactersIgnoringModifiers]; unichar c = [chars characterAtIndex:0]; - unichar imc = [unmodchars characterAtIndex:0]; + unichar imc = [unmodchars length] > 0 ? [unmodchars characterAtIndex:0] : 0; int len = 0; const char *bytes = 0; int mods = [event modifierFlags];