Skip to content

Commit

Permalink
check for null lxmf display names
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcottle committed Oct 12, 2024
1 parent 6234785 commit 49ee7de
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions meshchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2355,11 +2355,16 @@ def get_lxmf_conversation_name(self, destination_hash):

# reads the lxmf display name from the provided base64 app data
def parse_lxmf_display_name(self, app_data_base64: str, default_value: str | None = "Anonymous Peer"):

try:
app_data_bytes = base64.b64decode(app_data_base64)
return LXMF.display_name_from_app_data(app_data_bytes)
display_name = LXMF.display_name_from_app_data(app_data_bytes)
if display_name is not None:
return display_name
except:
return default_value
pass

return default_value

# reads the lxmf stamp cost from the provided base64 app data
def parse_lxmf_stamp_cost(self, app_data_base64: str):
Expand Down

0 comments on commit 49ee7de

Please sign in to comment.