summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/runtime/iosys.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 3e4b9bc79968..bbdfcf91c044 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -983,7 +983,7 @@ void SbiIoSystem::WriteCon(const OUString& rText)
}
OUString s(aOut.copy(0, n1));
aOut = aOut.copy(n1);
- while (aOut[0] == '\n' || aOut[0] == '\r')
+ while ( !aOut.isEmpty() && (aOut[0] == '\n' || aOut[0] == '\r') )
{
aOut = aOut.copy(1);
}