diff --git a/src/MacVim/MMCoreTextView.m b/src/MacVim/MMCoreTextView.m index 3aed3568fe..b161015385 100644 --- a/src/MacVim/MMCoreTextView.m +++ b/src/MacVim/MMCoreTextView.m @@ -927,6 +927,10 @@ defaultAdvanceForFont(CTFontRef fontRef) // Convert UTF-8 chars to UTF-16 CFStringRef sref = CFStringCreateWithBytesNoCopy(NULL, s, len, kCFStringEncodingUTF8, false, kCFAllocatorNull); + if (sref == NULL) { + ASLogWarn(@"Conversion error: some text may not be rendered"); + continue; + } CFIndex unilength = CFStringGetLength(sref); const UniChar *unichars = CFStringGetCharactersPtr(sref); UniChar *buffer = NULL;