[Backport] Prevent some ObjectDoesNotExist exceptions