-
- wxASSERT( index < m_history.GetCount() );
-
- m_filename = m_history[index];
-
- m_text->Clear();
- m_text->LoadFile( m_filename );
-
- SetStatusText( m_filename );
+
+ if( index < m_history.GetCount() )
+ {
+ m_filename = m_history[index];
+
+ m_text->Clear();
+ m_text->LoadFile( m_filename );
+
+#if wxUSE_STATUSBAR
+ SetStatusText( m_filename );
+#endif // wxUSE_STATUSBAR
+ }
+ else
+ {
+ wxMessageBox(
+ _T("This entry is empty. It should be filled once you will start opening."),
+ _T("Empty entry"),
+ wxOK | wxICON_INFORMATION,
+ this
+ );
+ }