diff --git a/tags/faq/assert.ytag b/tags/faq/assert.ytag index 3919db8..e94dd4f 100644 --- a/tags/faq/assert.ytag +++ b/tags/faq/assert.ytag @@ -2,5 +2,5 @@ type: text --- -You should avoid using `assert` in your mod code. If the assert passes, it will work as expected. However, if it fails, or if assertions are disabled (default behavior), Minecraft will crash. +You should avoid using `assert` in your mod code. If the assert passes, it will work as expected. However, if it fails, Minecraft will crash. Assertions are also disabled by default in the JVM, and will be ignored, which may lead to undefined behavior and potentially a NullPointerException. Instead of using the assertion pattern `assert someObject != null;`, you should use the null-checking pattern: `if (someObject != null) { /* Code here */ }