Skip to content

Commit

Permalink
Fixed #38: Additions are always optionals
Browse files Browse the repository at this point in the history
  • Loading branch information
Futsch1 committed Mar 21, 2022
1 parent 799b7d5 commit 1d08c1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion asn1editor/ViewControllerFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ def _sequence(self, type_: oer.Sequence, checker: constraints_checker.Dict, cont

sub_controller = ControllerFactory(controller).create_container_controller(type_, optional_interface)

for sub_type in type_.root_members + ([] if type_.additions is None else type_.additions):
# Additions are always optional
additions = [] if type_.additions is None else type_.additions
for sub_type in additions:
sub_type.optional = True

for sub_type in type_.root_members + additions:
view.add_child(self.create_view_and_controller(sub_type, self.__get_member_checker(checker, sub_type.name), sub_controller))

return view
Expand Down

0 comments on commit 1d08c1c

Please sign in to comment.