mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2024-11-17 07:48:27 +01:00
Do not crash when there is no dictionary and a search is requested
This commit is contained in:
parent
ba11fc3be6
commit
95ebd73a80
1 changed files with 16 additions and 4 deletions
|
@ -999,7 +999,11 @@ MainFrame::SetRack(Game::set_rack_mode mode, wxString srack)
|
|||
void
|
||||
MainFrame::Search()
|
||||
{
|
||||
((Training*)m_game)->removeTestPlay();
|
||||
if (m_game == NULL || m_game->getDic() == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
static_cast<Training*>(m_game)->removeTestPlay();
|
||||
#ifdef ENABLE_RESLIST_IN_MAIN
|
||||
reslist->Search();
|
||||
#else
|
||||
|
@ -1015,7 +1019,11 @@ MainFrame::Search()
|
|||
void
|
||||
MainFrame::Play(int n)
|
||||
{
|
||||
((Training*)m_game)->removeTestPlay();
|
||||
if (m_game == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
static_cast<Training*>(m_game)->removeTestPlay();
|
||||
if (n < 0)
|
||||
{
|
||||
debug("MainFrame::Play back %d\n",n);
|
||||
|
@ -1044,8 +1052,12 @@ MainFrame::Play(int n)
|
|||
void
|
||||
MainFrame::TestPlay(int n)
|
||||
{
|
||||
((Training*)m_game)->removeTestPlay();
|
||||
((Training*)m_game)->testPlay(n);
|
||||
if (m_game == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
static_cast<Training*>(m_game)->removeTestPlay();
|
||||
static_cast<Training*>(m_game)->testPlay(n);
|
||||
UpdateFrames();
|
||||
UpdateStatusBar();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue