sullerandras / UtilizationMonitor

UtilizationMonitor: Factorio mod to see if factories are fully utilized
MIT License
0 stars 6 forks source link

Fixes NPE when the next data to be processed has been removed. Fixes #17 #18

Closed ST-DDT closed 6 years ago

ST-DDT commented 6 years ago

Probably only occurs in some (highly optimized?) environments.

Fixes #17

sullerandras commented 6 years ago

Thanks for helping out! Have you managed to reproduce the issue? I had no luck so far. We can merge this in and i release a new version if it fixes the issue.

ST-DDT commented 6 years ago

I sent this solution to @abordoli / Bordo via IRC and he tested that version, for him this fix solved the crash issue.

I wasn't able to reproduce the crash myself. I assume this is caused by some sort of "special game adjustments/optimizations" that might change the order of the events slightly/make the application more deterministic or just really bad luck. I see why it crashed for him, but I'm not sure why it didn't crash for everyone else.^^ (Or why it crashed that often for him. On a big map the chance of this happening are very close to zero. (1 / no. of tracked entities))

Theoretically this should be reproducible by reducing the updates per tick to 1 and building and deconstructing 2-3 furnances on a new map repeatedly. Chances are below 33-50% though.

sullerandras commented 6 years ago

@ST-DDT Can you bump the version and add something to the changelog? Then i'll release it.

I never had crash issues, he must be very unlucky. Or maybe it depends on the computer's performance? Or the size of the factory? Or other mods affecting this mod somehow.

ST-DDT commented 6 years ago

@sullerandras Done

sullerandras commented 6 years ago

Released the new version.