- wxString& GetFirstLine() /* const */ { return m_aLines[m_nCurLine = 0]; }
- wxString& GetNextLine() /* const */ { return m_aLines[++m_nCurLine]; }
+ wxString& GetFirstLine() /* const */
+ { return m_aLines.empty() ? ms_eof : m_aLines[m_nCurLine = 0]; }
+ wxString& GetNextLine() /* const */
+ { return ++m_nCurLine == m_aLines.size() ? ms_eof
+ : m_aLines[m_nCurLine]; }