Read Time:22 Second
Description
Catching NullPointerException should not be used as an alternative to programmatic checks to prevent dereferencing a null pointer.
Modes of Introduction:
– Implementation
Related Weaknesses
Consequences
Availability: DoS: Resource Consumption (CPU)
Potential Mitigations
Phase: Architecture and Design, Implementation
Description:
Do not extensively rely on catching exceptions (especially for validating user input) to handle errors. Handling exceptions can decrease the performance of an application.