0

I want to check if date from database is empty like this:

private boolean hasAccountExpired(LocalDateTime password_changed_at) {

        return password_changed_at.isEqual(null);
}

But I get NPE. What is the proper way to check if date field from database is empty?

Peter Penzov
  • 2,352
  • 100
  • 358
  • 675

1 Answers1

1

password_changed_at == null will tell you if it's null.

However, this doesn't necessarily tell you if it's empty in the database - that depends on your implementation.

Michael Berry
  • 66,225
  • 20
  • 144
  • 202