Are you experiencing this error in latest version of Jomsocial 4.9.5? as I remember we fixed this error in previous version already.
If it still has issue, you can share me the file and clarify the step to replicate this issue on your site so I can help you out.