1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

check list length

This commit is contained in:
Michael
2023-07-20 02:20:54 +02:00
committed by GitHub
parent 3484059a40
commit a86406d090

View File

@@ -326,12 +326,12 @@ void SelectionTab::clickDouble(const Point & cursorPosition)
void SelectionTab::showPopupWindow(const Point & cursorPosition) void SelectionTab::showPopupWindow(const Point & cursorPosition)
{ {
if(!curItems.size())
return;
int position = getLine(); int position = getLine();
int py = position + slider->getValue(); int py = position + slider->getValue();
if(py >= curItems.size())
return;
std::string text = "{" + curItems[py]->getName() + "}\n\n" + curItems[py]->fileURI; std::string text = "{" + curItems[py]->getName() + "}\n\n" + curItems[py]->fileURI;
if(curItems[py]->date != "") if(curItems[py]->date != "")