thunderbird / addons-server

🕶 addons.thunderbird.net Django app and API, forked from addons.mozilla.org 🎉
https://addons.thunderbird.net
BSD 3-Clause "New" or "Revised" License
18 stars 17 forks source link

Handle serialization of null arguments for activity log items #287

Closed MelissaAutumn closed 6 months ago

MelissaAutumn commented 6 months ago

On production viewing the activity logs produces a 500 error during serialization of the arguments.

Occurs: https://github.com/thunderbird/addons-server/blob/master/src/olympia/activity/models.py#L388

Due to: https://github.com/thunderbird/addons-server/blob/master/src/olympia/activity/models.py#L309

Suggested fix: Add a none check to to_string before the argument loop and return "" or something to that effect.

MelissaAutumn commented 6 months ago

On futher investigation it seems like we're trying to json.loads an empty string. So we should also add an empty string check for arguments.