From e71f402b6de71412178c5fbaaab1fc8ec6a93032 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Wed, 22 Aug 2007 17:19:09 +0000 Subject: [PATCH] Check for nil string argument in replaceString::::::: git-svn-id: http://macvim.googlecode.com/svn/trunk@179 96c4425d-ca35-0410-94e5-3396d5c13a8f --- MMTextStorage.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MMTextStorage.m b/MMTextStorage.m index 97ae7f2c0e..adeae57ad3 100644 --- a/MMTextStorage.m +++ b/MMTextStorage.m @@ -169,6 +169,11 @@ return; } + // NOTE: If 'string' was initialized with bad data it might be nil; this + // may be due to 'enc' being set to an unsupported value, so don't print an + // error message or stdout will most likely get flooded. + if (!string) return; + if (!(fg && bg && sp)) { NSLog(@"[%s] WARNING: background, foreground or special color not " "specified", _cmd);