diff --git a/SoObjects/SOGo/NSString+Utilities.m b/SoObjects/SOGo/NSString+Utilities.m index b7defaa4c..d1facda78 100644 --- a/SoObjects/SOGo/NSString+Utilities.m +++ b/SoObjects/SOGo/NSString+Utilities.m @@ -739,7 +739,7 @@ static int cssEscapingCount; substrLen = [substring length]; matchRange = NSMakeRange (0, selfLen); - while (!done) + while (!done && matchRange.length > 0) { substrRange = [self rangeOfString: substring options: 0 range: matchRange]; if (substrRange.location == NSNotFound)