瀏覽代碼

check list length

Michael 2 年之前
父節點
當前提交
a86406d090
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      client/lobby/SelectionTab.cpp

+ 6 - 6
client/lobby/SelectionTab.cpp

@@ -326,17 +326,17 @@ 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 != "")
 	     text += "\n\n" + curItems[py]->date;
 	     text += "\n\n" + curItems[py]->date;
-	
+
 	CRClickPopup::createAndPush(text);
 	CRClickPopup::createAndPush(text);
 }
 }