Fixed crash caused by trying to cast and dereference a NULL hChannel.