#2939 is a small function for calculating the orbits of companion stars. This function runs fairly often, so looks like an intermittent bug. The only objects referenced are the Star Type and the Parent Star, so perhaps the function is running when the latter doesn't exist - maybe for the primary. I'll add a check for that.
BTW I've just generated about 50 systems in a random stars game without the bug appearing, so it does seem fairly rare. Hard to fix though unless I can reproduce it. I'll keep trying.
Thank you for investigating!
I just created 90 systems without issue, using the "Create System" button, so I'd agree it's relatively rare.
It seems decidedly less rare when using "Create Habitable", occurring within an average of 4-5 created systems, up to a maximum in my testing of 12 - I assume this is due to a large number of systems being created and discarded behind the scenes to find viable habitable targets.