Explorar el Código

Added a range check on GetDragElement(unsigned).

hdunderscore hace 11 años
padre
commit
00656c5d30
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      Source/Engine/UI/UI.cpp

+ 3 - 0
Source/Engine/UI/UI.cpp

@@ -646,6 +646,9 @@ const Vector<UIElement*> UI::GetDragElements()
 UIElement* UI::GetDragElement(unsigned index)
 {
     GetDragElements();
+    if (index >= dragElementsConfirmed_.Size())
+        return (UIElement*)0;
+        
     return dragElementsConfirmed_[index];
 }