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
  • 1,126
  • 134
  • 430
  • 808

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
  • 70,193
  • 21
  • 157
  • 216