Path: blob/main/release-content/migration-guides/generic-option-parameter.md
6592 views
---
---
Option<Single<D, F>>
will now resolve to None
if there are multiple entities matching the query. Previously, it would only resolve to None
if there were no entities, and would skip the system if there were multiple.
We have introduced a blanket impl SystemParam for Option
that resolves to None
if the parameter is invalid. This allows third-party system parameters to work with Option
, and makes the behavior more consistent.
If you want a system to run when there are no matching entities but skip when there are multiple, you will need to use Query<D, F>
and call single()
yourself.