Просмотр исходного кода

Fixed a crash when initializing a list box with zero elements

BearishSun 9 лет назад
Родитель
Сommit
fba359f972
1 измененных файлов с 4 добавлено и 1 удалено
  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")));
 		}
 	}