added null check
Merge pull request #47 from thehelpsf/feature/bug-fix-chat

added null check