Assertion failed
LemADEC opened this issue ยท 3 comments
Issue description:
Mods fails to boot when assertion are enabled
Steps to reproduce:
- 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.
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"
}