pp-chat: Update ui_data only if non-NULL

Otherwise we are dereferencing a NULL value

Likely Fixes #415
8 jobs for wip/sadiq/fix-crash in 13 minutes and 24 seconds