Răsfoiți Sursa

Fixed a crash when initializing a list box with zero elements

BearishSun 9 ani în urmă
părinte
comite
fba359f972
1 a modificat fișierele cu 4 adăugiri și 1 ștergeri
  1. 4 1
      Source/BansheeEngine/Source/BsGUIListBox.cpp

+ 4 - 1
Source/BansheeEngine/Source/BsGUIListBox.cpp

@@ -246,7 +246,10 @@ namespace BansheeEngine
 		}
 		else
 		{
-			setContent(GUIContent(mElements[selectedIdx]));
+			if(!mElements.empty())
+				setContent(GUIContent(mElements[selectedIdx]));
+			else
+				setContent(GUIContent(HEString(L"None")));
 		}
 	}