Commit a11607ce authored by gerstrong@gmail.com's avatar gerstrong@gmail.com

Fixed crash with selection border on a empty game list

parent c468f2d9
......@@ -713,19 +713,22 @@ void CGameLauncher::ponderGameSelDialog(const float deltaT)
// Check if the selection changed. Update the right data panel
if(mSelection != mpGameSelectionList->getSelection())
{
mSelection = mpGameSelectionList->getSelection();
auto &entry = m_Entries[mSelection];
const std::string nameText = "Episode " + itoa(entry.episode);
mpEpisodeText->setText(nameText);
float fVer = entry.version;
fVer /= 100.0f;
mpVersionText->setText("Version: " + ftoa(fVer));
mpDemoText->setText(entry.demo ? "Demo" : "");
// Now update the bitmap
mCurrentBmp->setBitmapPtr(mPreviewBmpPtrVec[mSelection]);
{
if(!m_Entries.empty())
{
mSelection = mpGameSelectionList->getSelection();
auto &entry = m_Entries[mSelection];
const std::string nameText = "Episode " + itoa(entry.episode);
mpEpisodeText->setText(nameText);
float fVer = entry.version;
fVer /= 100.0f;
mpVersionText->setText("Version: " + ftoa(fVer));
mpDemoText->setText(entry.demo ? "Demo" : "");
// Now update the bitmap
mCurrentBmp->setBitmapPtr(mPreviewBmpPtrVec[mSelection]);
}
}
mLauncherDialog.processLogic();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment