codemaker: fix invalid string index access

Change-Id: Icca819484e751864d146a893fe78e8ef2c36363b
This commit is contained in:
Michael Stahl 2013-11-06 17:37:42 +01:00
parent 10dc66052a
commit 614e04019a

View file

@ -87,8 +87,9 @@ OString createFileNameFromType( const OString& destination,
length += prefix.getLength() + type.getLength() + postfix.getLength();
sal_Bool withSeparator = sal_False;
if (destination[destination.getLength()] != '\\' &&
destination[destination.getLength()] != '/' &&
if (!destination.isEmpty() &&
destination[destination.getLength() - 1] != '\\' &&
destination[destination.getLength() - 1] != '/' &&
type[0] != '\\' &&
type[0] != '/')
{