protect against referencing a property of a non-existent object
Merge pull request #236 from qq99/master

Fixes #235 type error where channel does not exist