Check if application is not null before deleting it.