Crash at Box2D.Collision::b2PairManager/AddPair() : 251

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Box2D.Collision::b2PairManager/AddPair()[[path]\Box2D\Collision\b2PairManager.as:251]

This happens when I spawn more than 60-80 bodies on the level that are assigned velocity every tick. In this situation fps/tps drops below 2-3 frames/ticks and this gives this crash. Any ideas? Memory usage is near to 17 megs.
Are all the bodies overlapping, or created in an initial position that would cause overlap in the same frame? That reaches the maximun allowed amount of pairs pretty quickly as you have n^2 pairs. IIRC 92 shapes overlapping is enough to use up the default allocated amount, so 80 sounds about right if other stuff is going on too.

I cannot think of any issues to do with setting the velocity every frame.
Well, there is attached screenshot, where a lot of shapes and bodies are in collision. So, it should be that limit of pairs is reached..
Doesn't look too likely. You don't have that many shapes overlapping. All the same, try upping the pair and proxy limits in b2Settings.

Original thread: https://box2d.org/forum/viewtopic.php?t=3999