GjjvdBurg / signal2html

Export a Signal backup to pretty HTML
MIT License
111 stars 15 forks source link

Handle mentions being None #49

Closed GjjvdBurg closed 3 years ago

GjjvdBurg commented 3 years ago

Not sure why this was None in the first place, which may be worth investigating still. Fixes #48.

Update: I guess it is None when msg_id is not in thread.mentions. I don't know if that's expected or not here, but if it's not an issue then I think the fix is fine.

ericthegrey commented 3 years ago

Update: I guess it is None when msg_id is not in thread.mentions. I don't know if that's expected or not here, but if it's not an issue then I think the fix is fine.

I think you're right. We could also modify the get call to thread.mentions.get(msg._id, {})

GjjvdBurg commented 3 years ago

I think you're right. We could also modify the get call to thread.mentions.get(msg._id, {})

That's true, although using mutable defaults for keyword arguments is a bit of a Python "gotcha", so using None is probably preferred.

ericthegrey commented 3 years ago

Oh, that's right. Well, then :+1: