diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index cf2530f6e47d..7578f85241b2 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -513,7 +513,7 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt ) HighlightPortions aPortions; aHighlighter.getHighlightPortions( nLine, aLine, aPortions ); - if( aLine[aLine.getLength()-1] != '"' && (aPortions[aPortions.size()-1].tokenType != 4) ) + if( aLine.getLength() > 0 && aLine[aLine.getLength()-1] != '"' && (aPortions[aPortions.size()-1].tokenType != 4) ) { GetEditView()->InsertText(OUString("\"")); //leave the cursor on it's place: inside the two double quotes