dungeon-sheets icon indicating copy to clipboard operation
dungeon-sheets copied to clipboard

create-character fails if no armor option is selected

Open geckon opened this issue 5 years ago • 0 comments

Traceback (most recent call last):
  File "/home/theger/tmp/dungeon-sheets/venv/bin/create-character", line 11, in <module>
    sys.exit(main())
  File "/home/theger/tmp/dungeon-sheets/venv/lib64/python3.6/site-packages/dungeonsheets/create_character.py", line 732, in main
    my_app.run()
  File "/home/theger/tmp/dungeon-sheets/venv/lib64/python3.6/site-packages/npyscreen/apNPSApplication.py", line 30, in run
    return npyssafewrapper.wrapper(self.__remove_argument_call_main)
  File "/home/theger/tmp/dungeon-sheets/venv/lib64/python3.6/site-packages/npyscreen/npyssafewrapper.py", line 41, in wrapper
    wrapper_no_fork(call_function)
  File "/home/theger/tmp/dungeon-sheets/venv/lib64/python3.6/site-packages/npyscreen/npyssafewrapper.py", line 97, in wrapper_no_fork
    return_code = call_function(_SCREEN)    
  File "/home/theger/tmp/dungeon-sheets/venv/lib64/python3.6/site-packages/npyscreen/apNPSApplication.py", line 25, in __remove_argument_call_main
    return self.main()
  File "/home/theger/tmp/dungeon-sheets/venv/lib64/python3.6/site-packages/npyscreen/apNPSApplicationManaged.py", line 172, in main
    self._THISFORM.edit()
  File "/home/theger/tmp/dungeon-sheets/venv/lib64/python3.6/site-packages/npyscreen/fmActionForm.py", line 77, in edit
    self.edit_return_value = self.on_ok()
  File "/home/theger/tmp/dungeon-sheets/venv/lib64/python3.6/site-packages/dungeonsheets/create_character.py", line 632, in on_ok
    my_armor = self.armor.get_selected_objects()[0]
IndexError: list index out of range

Either selecting one option (e.g. "no armor") should be enforced, or one of the options should be made default, or at least this should fail gracefully.

geckon avatar Aug 12 '19 18:08 geckon