summaryrefslogtreecommitdiff
path: root/basic/source/runtime/methods.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source/runtime/methods.cxx')
-rw-r--r--basic/source/runtime/methods.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 200b7b749759..31825c8277dc 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1308,7 +1308,8 @@ RTLFUNC(Mid)
{
nLen = aArgStr.getLength() - nStartPos;
}
- aResultStr = aArgStr.copy( nStartPos, nLen );
+ if (nLen > 0)
+ aResultStr = aArgStr.copy( nStartPos, nLen );
}
rPar.Get(0)->PutString( aResultStr );
}