Add null check before attempting to get last four