Sfoglia il codice sorgente

Fixed a crash when initializing a list box with zero elements

BearishSun 9 anni fa
parent
commit
fba359f972
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  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")));
 		}
 	}