Protect some code against NoEntityException