Mekanism

Mekanism

111M Downloads

Assertion failed

LemADEC opened this issue ยท 3 comments

commented

Issue description:

Mods fails to boot when assertion are enabled

Steps to reproduce:

  1. boot with assertion enabled

Version (make sure you are on the latest version before reporting):

Forge: 14.23.5.2770
Mekanism: 1.12.2-9.4.13
Other relevant version:

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

https://github.com/aidancbrady/Mekanism/blob/master/src/main/java/mekanism/client/MekKeyHandler.java#L23
Assertion check is done before affecting properties, leading to NPE.

commented

How about providing some useful info, like the crash report

commented

This is a code review finding.
You can directly check the line of the code that was linked.
You can use an advanced IDE like IntelliJ IDEA that tells you there's a problem on that line.
Finally, you can actually enable assertion checks. For example, this can be done by adding below lines to your gradle script:

runClient {
    jvmArgs "-Xmx2048m", "-Xms1024m", "-ea"
}

runServer {
    jvmArgs "-Xmx2048m", "-Xms1024m", "-ea"
}
commented

Bold of you to assume I don't know how to enable assertions. How bout you actually be helpful since you already encountered the crash.