Skip to content

Commit

Permalink
[Ui] Change VSystem to assertion check
Browse files Browse the repository at this point in the history
  • Loading branch information
skerdudou committed Jan 17, 2025
1 parent 4c61882 commit 083629b
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.List;
import java.util.Map;

import io.vertigo.core.lang.VSystemException;
import io.vertigo.core.lang.Assertion;
import io.vertigo.datamodel.data.model.DataObject;
import io.vertigo.ui.impl.springmvc.util.UiRequestUtil;
import io.vertigo.vega.webservice.validation.UiMessageStack;
Expand Down Expand Up @@ -139,9 +139,10 @@ public void info(final String message, final DataObject dto, final String fieldN
@Override
public void addFieldMessage(final Level level, final String message, final DataObject dto, final String fieldName) {
final var dtoKey = UiRequestUtil.getCurrentViewContext().findKey(dto);
if (dtoKey == null) {
throw new VSystemException("The provided dataObject is not in the current context");
}

Assertion.check()
.isNotNull(dtoKey, "The provided dataObject is not in the current context");

addFieldMessage(level, message, dtoKey, fieldName);
}

Expand Down

0 comments on commit 083629b

Please sign in to comment.