summaryrefslogtreecommitdiff
path: root/codemaker
diff options
context:
space:
mode:
Diffstat (limited to 'codemaker')
-rw-r--r--codemaker/source/codemaker/global.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/codemaker/source/codemaker/global.cxx b/codemaker/source/codemaker/global.cxx
index d6c5a0fae942..ba3f42484d5a 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -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] != '/')
{