PatternFormatter fix, added test

This commit is contained in:
Guenter Obiltschnig
2015-08-20 20:23:13 +02:00
parent fafe691a04
commit ec71e76f0a
2 changed files with 25 additions and 5 deletions

View File

@@ -256,13 +256,18 @@ void PatternFormatter::parsePriorityNames()
{
_priorities[i] = priorities[i];
}
StringTokenizer st(_priorityNames, ",;", StringTokenizer::TOK_TRIM);
if (st.count() == 8)
if (!_priorityNames.empty())
{
for (int i = 1; i <= 8; i++)
_priorities[i] = st[i - 1];
StringTokenizer st(_priorityNames, ",;", StringTokenizer::TOK_TRIM);
if (st.count() == 8)
{
for (int i = 1; i <= 8; i++)
{
_priorities[i] = st[i - 1];
}
}
else throw Poco::SyntaxException("priorityNames property must specify a comma-separated list of 8 property names");
}
else throw Poco::SyntaxException("priorityNames property must specify a comma-separated list of 8 property names");
}