Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhelpfull error: NPE if a PlanningListVariable on a PlanningEntity is null #107

Closed
ge0ffrey opened this issue Jun 17, 2023 · 0 comments · Fixed by #140
Closed

Unhelpfull error: NPE if a PlanningListVariable on a PlanningEntity is null #107

ge0ffrey opened this issue Jun 17, 2023 · 0 comments · Fixed by #140
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ge0ffrey
Copy link
Contributor

ge0ffrey commented Jun 17, 2023

I have a Vehicle with a null List<Visit> visits and I get this error:

java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because the return value of "ai.timefold.solver.core.impl.domain.variable.descriptor.ListVariableDescriptor.getListVariable(Object)" is null
	at ai.timefold.solver.core.impl.domain.variable.descriptor.ListVariableDescriptor.getListSize(ListVariableDescriptor.java:118)

To reproduce, take the vrp quickstart and create a Vehicle with a null visit list.

Ideally, the error message should point out that the visits field of Vehicle (id) is null.

@ge0ffrey ge0ffrey added bug Something isn't working process/needs triage Requires initial assessment of validity, priority etc. labels Jun 17, 2023
@triceo triceo added enhancement New feature or request and removed process/needs triage Requires initial assessment of validity, priority etc. bug Something isn't working labels Jun 17, 2023
triceo added a commit to triceo/timefold-solver that referenced this issue Jun 28, 2023
@triceo triceo added this to the 1.0.0 milestone Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants