The from side when "empty" will still return a table, the to side when empty can return nil:
/c game.print(serpent.line(game.player.cursor_stack.get_mapper(1, "from"))) -- {type = "item"}
/c game.print(serpent.line(game.player.cursor_stack.get_mapper(1, "to"))) -- nil
upgrade planner's get_mapper()'s to can return nil
upgrade planner's get_mapper()'s to can return nil
- Attachments
-
- Screenshot 2025-05-08 at 13.55.53.png (41.31 KiB) Viewed 244 times
Re: upgrade planner's get_mapper()'s to can return nil
Isn't this more of a bug? Returning "{type = "item"}" doesn't make sense right? Should be nil?
Re: upgrade planner's get_mapper()'s to can return nil
well it makes sense in the way that the slot is reserved and there isn't a nil gap, like empty logistic filters in a section return {} and not nil too, which way belongs where is very much just in the eye of the devs 
There's probably a technical reason here why the source needs to be set to something not-nil when there's just a destination defined, i'll leave it up to you guys to figure out whether the destination should be marked as optional, making both return a table, or making both optional

There's probably a technical reason here why the source needs to be set to something not-nil when there's just a destination defined, i'll leave it up to you guys to figure out whether the destination should be marked as optional, making both return a table, or making both optional

Re: upgrade planner's get_mapper()'s to can return nil
Alrighty updated the docs for the next release to mention this, and added some missing fields to UpgradeMapperSource and UpgradeMapperDestination . Thanks for the report.
Re: upgrade planner's get_mapper()'s to can return nil
Makes sense now, if the "from" side needs to stay non-nil for internal consistency, like how empty logistics filters return {}. Good call raising it, and thank you