Fixed a missing check for null in account