I got "Object reference not set to an instance of an object" errors twice. Both were in the same game session (the game had not been shut down in between them) so this could be something that was just a fluke and won't happen again. I'm embarrassed to say I didn't grab a screenshot of either error.
I can tell you exactly what I was doing both times. On both occasions, the error occurred when a survey ship explored a new jump point and a new system was generated. In both cases, there were habitable (CC <2) planets in the system with inhabitants on them. In both cases, no fleets were generated for those alien races. , just populations.
In one case, they seem to have nothing and won't talk to me despite me having a diplomatic ship over their planet with active sensors and friendly transponder on for years. When I say they won't talk to me, I mean I'm not even getting any message about them refusing to communicate or not being unable to translate or anything like that. Just no messages at all. There is a dormant construct on a different planet in the system. Maybe they're some kind of spoiler? I don't know if it's possible to find "primitive" races that don't have technology. If so, maybe it's that.
The other one is a bit stranger. As I approached the planet, I detected a second population on the planet (and I think I got the same error message but it was late and a few days ago so I can't remember). They did have a small amount of ground forces and some STOs that shot at my survey ship. I also parked a diplomatic ship nearby and I did get messages about one race refusing to talk. No messages about the other. I also had a ship with ELINT gear parked outside of range and it never got any intelligence on them. Seeing how they shot at me and won't talk and, er, well, their planet is so nice and their ground forces were so small, I decided to dump a large ground force on the planet to take it. Bad, bad idea, apparently. Turns out one of those races is called "Rhakas" or something like that and they slaughtered over 150k tons of ground forces without taking any casualties that I can tell. I can tell because I got combat reports while fighting that said that various ground units had been identified as rhakas (whatever) but no casualty reports for them. The other race on the planet doesn't appear to be interacting with me or the rhakas at all.
My guess is that something is going on with generating new NPRs or what people call "spoilers". (Speaking of which, I have not encountered the new "spoiler" despite having a couple dozen systems explored.
I had originally encountered an NPR that appears to have been generated normally. I only got one jump point in SOL and I made more with SM after encountering the first NPR and I got these errors after while exploring beyond those so maybe that's connected?
I've continued to explore in hopes of generating the error again so I can get a screenshot but I have not found any new NPRs since.
I have copies of the database from after the first but before the second error. I tried exploring the same jump point as the second again from the save but didn't get the same system or an NPR or an error. I also have more recent copies of the database and I believe I still have a copy of the database I made before I generated the extra jump points. I can provide any of those if you think f they will help.
Editing to add: I reloaded the save from before the failed invasion. I SM moved the invasion fleet to the other NPR that threw an error when I entered the system. Invading them showed they were a regular NPR with some token ground forces but nothing else. Not even any ground installations. So the error isn’t just confined to spoilers.