Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.exceptions

Do not catch NullPointerException

NullPointerException indicates a programming error.

#Metadata

Rule ID
java.correctness.catch-null-pointer
Severity
low
Confidence
0.88
Languages
java
Presets
strict
Stability
stable
Applies to
block
Tags
correctness, java, rules-catalog

#Why it matters

Catching NPE masks bugs that should be fixed at the source.

#Remediation

Add null checks or Optional handling at the source of the failure.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/java/java.correctness.catch-null-pointer.rule.yaml.