[Minor bug] InvalidOperationException while GameObject with RVOController is selected in Inspector

I was testing local avoidance and ran into an exception as soon as I started adding RVOController to my GameObjects. It took me a bit to figure out that the exception actually only occurs if the GameObject is selected in the Inspector, and I was able to reproduce it on the RTS example scene as well.

Setup:

  • A* Pathfinding Pro 4.3.94
  • Unity 2023.2.8f1

Repro:

  • Open the 4.3.94\RTS example scene
  • Enter play mode in the editor
  • In the Hierarchy, expand “Large group of units” and select one of the units
  • You should immediately be spammed with the exception below:

InvalidOperationException: The previously scheduled job JobDestinationReached1 writes to the Unity.Collections.NativeArray1[System.Int32] JobDestinationReached1.output.numNeighbours. You must call JobHandle.Complete() on the job JobDestinationReached1, before you can read from the Unity.Collections.NativeArray`1[System.Int32] safely.
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckReadAndThrowNoEarlyOut (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <6b66e7caaeb045048a0fbc11f111e6fa>:0)
Pathfinding.RVO.SimulatorBurst+Agent.get_NeighbourCount () (at ./Library/PackageCache/com.arongranberg.astar@4.3.94/Core/RVO/RVOCoreSimulatorBurst.cs:527)
Pathfinding.RVO.RVOControllerEditor.Inspector () (at ./Library/PackageCache/com.arongranberg.astar@4.3.94/Editor/RVOControllerEditor.cs:54)
Pathfinding.EditorBase.OnInspectorGUI () (at ./Library/PackageCache/com.arongranberg.astar@4.3.94/PackageTools/Editor/EditorBase.cs:96)
UnityEngine.Debug:LogException(Exception, Object)
Pathfinding.EditorBase:OnInspectorGUI() (at ./Library/PackageCache/com.arongranberg.astar@4.3.94/PackageTools/Editor/EditorBase.cs:101)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

The exception stops if you disable the RVO Controller component.

Thanks! I’ll include a fix in the next update.