diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 36d7c3cba782..efa3ea9d8c6b 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -1302,7 +1302,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 ); }