Ensure we don't access the vector with an out of bounds index

This commit is contained in:
Max Vollmer (Microsoft Havok)
2021-11-26 13:01:00 +00:00
parent da8772c57b
commit 38382715f7

View File

@@ -300,7 +300,7 @@ public:
inline unsigned int GetIndex() const { return index; }
operator bool() const { return vector != 0; }
operator bool() const { return vector != nullptr && index < vector->size(); }
T *operator->() { return (*vector)[index]; }