Fix crash of navigation agents callback when object is invalid

Fix crash of navigation agents callback when object is invalid.

(cherry picked from commit bc38ebe4f0)
This commit is contained in:
smix8 2022-06-14 13:04:02 +02:00 committed by Rémi Verschelde
parent 6ecdef84cf
commit b0a8bcdf49
1 changed files with 2 additions and 1 deletions

View File

@ -65,8 +65,9 @@ void RvoAgent::dispatch_callback() {
return; return;
} }
Object *obj = ObjectDB::get_instance(callback.id); Object *obj = ObjectDB::get_instance(callback.id);
if (obj == nullptr) { if (!obj) {
callback.id = ObjectID(0); callback.id = ObjectID(0);
return;
} }
Variant::CallError responseCallError; Variant::CallError responseCallError;