Skip to content

Commit

Permalink
chore: better exception when list variable is null (#140)
Browse files Browse the repository at this point in the history
Fixes #107.
  • Loading branch information
triceo authored Jun 28, 2023
1 parent 974531b commit 00ac56a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ public boolean isInitialized(Object entity) {
}

public List<Object> getListVariable(Object entity) {
return (List<Object>) getValue(entity);
Object value = getValue(entity);
if (value == null) {
throw new IllegalStateException("The planning list variable (" + this + ") of entity (" + entity + ") is null.");
}
return (List<Object>) value;
}

public Object removeElement(Object entity, int index) {
Expand Down

0 comments on commit 00ac56a

Please sign in to comment.