isamert / scli

a simple terminal user interface for signal messenger (using signal-cli)
GNU General Public License v3.0
449 stars 39 forks source link

Crash when contact has no "name" key #120

Closed AckslD closed 3 years ago

AckslD commented 3 years ago

When running scli I get the following error:

{'uuid': 'xxx', 'profileKey': 'xxx', 'lastUpdateTimestamp': 0, 'profile': None}
Traceback (most recent call last):
  File "/usr/bin/scli", line 4324, in <module>
    main()
  File "/usr/bin/scli", line 4309, in main
    coord = Coordinate()
  File "/usr/bin/scli", line 3685, in __init__
    self._contacts = Contacts(sigdata)
  File "/usr/bin/scli", line 987, in __init__
    self.reload()
  File "/usr/bin/scli", line 990, in reload
    indivs_dicts, groups_dicts = self._sigdata.parse_data_file()
  File "/usr/bin/scli", line 877, in parse_data_file
    profile_names = self._get_profile_names()
  File "/usr/bin/scli", line 936, in _get_profile_names
    num = prof['name']
KeyError: 'name'

Printing the prof shows that it only has the following keys:

{'uuid': 'xxx', 'profileKey': 'xxx', 'lastUpdateTimestamp': 0, 'profile': None}

Maybe this line could just be moved to the try/catch block? See #121

exquo commented 3 years ago

Thanks! FYI, there are uuid and profileKey in cleartext in the first line above the traceback, I assume unintentionally. I think you can edit them out and then delete the original edit.

AckslD commented 3 years ago

Woops, thanks for letting me know!