Explorar el Código

Fixed a crash when initializing a list box with zero elements

BearishSun hace 9 años
padre
commit
fba359f972
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  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")));
 		}
 	}