Add null check in ProfilePage.