PianoManu / BlockCarpentry

MIT License
6 stars 11 forks source link

Properly handle potential null mimic state in BlockColors. #57

Closed noobanidus closed 3 years ago

noobanidus commented 3 years ago

Within the context of Create's Schematicanon (and presumably any other world-snippet that's used for rendering), especially when combined with CCL, it seems eminently possible that getMimic can potentialyl return a null value. You even have a null-check for mimic in the FrameBlockTile's NBT writing. Relevant crash report here.

Obviously it's non-ideal, but Create's method is (as far as I'm aware) a perfectly valid use of a world-snippet for rendering. Likewise, there doesn't appears to be any guarantee that the mimic field of a TileEntity isn't null.

Adding a null check here prevents the null pointer exception.

PianoManu commented 3 years ago

Thank you very much!! I didn't notice this issue before... Regards, Manu

noobanidus commented 3 years ago

I just realised your master branch is 1.15.2, I'll re-create this for the 1.16 branches.

noobanidus commented 3 years ago

So, I can confirm that the crash is happening with a version in 1.16 but I'm not sure which; looking at your current code, it appears as though this was already resolved in the 1.16.2 branch.

noobanidus commented 3 years ago

It appears the pack this is occurring in is running an older version. I'll recommend the pack author update.

PianoManu commented 3 years ago

Just out of interest: which modpack were you using?

I just remembered this problem from #39, which I fixed some time ago, but completely forgot it the other day... Thanks, and best regards, Manu