Better Builder's Wands

Better Builder's Wands

89M Downloads

[1.10.2] Nullability violation causing crash with Literal Ascension

JamiesWhiteShirt opened this issue ยท 1 comments

commented

Forge: 1.10.2-forge1.10.2-12.18.3.2185
BBW: BetterBuildersWands-1.10.2-0.9.3.187+c619800.jar

Hi,

Playing SkyFactory 3, I experienced an unfortunate crash related to Literal Ascension and Better Builder's Wands. Holding a builder's wand, highlighting a Literal Ascension block, then looking away causes a crash, as seen in this crash log.

The only way this crash can happen is one of the parameters passed to getPickBlock being null. None of the parameters should be null according to the package-wide @ParametersAreNonnullByDefault. All parameters are guaranteed to be non-null in the one instance where called in forgesrc. The nature of Kotlin, the programming language Literal Ascension is written in, enforces nullability contracts with exceptions as seen in this instance.

Because 1) the crash happens when looking away from a block you previously looked at and 2) I looked at your source, I have reason to suspect that the raytrace results is null in this brief moment.

While you could argue this should be fixed on Literal Ascension's side (which I will gladly do if necessary), I believe looking into this might help avoid problems with other mods that may expect all the parameters of getPickBlock to be non-null.

Steps to reproduce:

  1. Install Literal Ascension, any version will do, and BBW.
  2. Look at a Literal Ascension block while holding a builder's wand.
  3. Look away from the block.

Thanks.

commented

Fixed.