updated.getEnvironment() == null ? null : updated.getEnvironment().getId();
if (environmentId != null && (toUpdate.getEnvironment() == null ||
!toUpdate.getEnvironment().getId().equals(environmentId))) {
Environment e = environmentCurator.find(environmentId);
if (e == null) {
throw new NotFoundException(i18n.tr(
"Environment with ID ''{0}'' could not be found.", environmentId));
}
toUpdate.setEnvironment(e);
// lazily regenerate certs, so the client can still work