diego-hermida / Java

All Algorithms implemented in Java
0 stars 0 forks source link

Other - Palindrome NullPointerException #26

Open carlosventoso opened 6 years ago

carlosventoso commented 6 years ago

If you try this : palindrome.isPalindrome(null) it throws java.lang.NullPointerException. Solutions:

  1. Cath the NullPointerException and return false.

  2. Document.

carlosventoso commented 6 years ago

Solved with a if (string == null)