diff --git a/src/unrealsdk/unreal/wrappers/gobjects.cpp b/src/unrealsdk/unreal/wrappers/gobjects.cpp index 040980b..5f9cccd 100644 --- a/src/unrealsdk/unreal/wrappers/gobjects.cpp +++ b/src/unrealsdk/unreal/wrappers/gobjects.cpp @@ -83,7 +83,7 @@ UObject* GObjects::get_weak_object(const FWeakObjectPtr* ptr) const { if (ptr->object_serial_number == 0) { return nullptr; } - if (ptr->object_index < 0) { + if (0 > ptr->object_index || ptr->object_index >= this->internal->ObjObjects.Count) { return nullptr; }