diff --git a/Source/HtmlRenderer/Core/Parse/CssParser.cs b/Source/HtmlRenderer/Core/Parse/CssParser.cs
index 045cbb687..cb6ef8975 100644
--- a/Source/HtmlRenderer/Core/Parse/CssParser.cs
+++ b/Source/HtmlRenderer/Core/Parse/CssParser.cs
@@ -625,9 +625,10 @@ private static string ParseImageProperty(string propValue)
private string ParseFontFamilyProperty(string propValue)
{
int start = 0;
- while (start > -1 && start < propValue.Length)
+
+ while (start < propValue.Length)
{
- while (char.IsWhiteSpace(propValue[start]) || propValue[start] == ',' || propValue[start] == '\'' || propValue[start] == '"')
+ while (start < propValue.Length && (char.IsWhiteSpace(propValue[start]) || propValue[start] == ',' || propValue[start] == '\'' || propValue[start] == '"'))
start++;
var end = propValue.IndexOf(',', start);
if (end < 0)
@@ -639,9 +640,7 @@ private string ParseFontFamilyProperty(string propValue)
var font = propValue.Substring(start, adjEnd - start + 1);
if (_adapter.IsFontExists(font))
- {
return font;
- }
start = end;
}