{"action":"closed","issue":{"url":"https://api.github.com/repos/oddnetworks/oddcast/issues/24","repository_url":"https://api.github.com/repos/oddnetworks/oddcast","labels_url":"https://api.github.com/repos/oddnetworks/oddcast/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/oddnetworks/oddcast/issues/24/comments","events_url":"https://api.github.com/repos/oddnetworks/oddcast/issues/24/events","html_url":"https://github.com/oddnetworks/oddcast/issues/24","id":160151683,"number":24,"title":"Not passing a payload causes unexpected exception","user":{"login":"kixxauth","id":97557,"avatar_url":"https://avatars.githubusercontent.com/u/97557?v=3","gravatar_id":"","url":"https://api.github.com/users/kixxauth","html_url":"https://github.com/kixxauth","followers_url":"https://api.github.com/users/kixxauth/followers","following_url":"https://api.github.com/users/kixxauth/following{/other_user}","gists_url":"https://api.github.com/users/kixxauth/gists{/gist_id}","starred_url":"https://api.github.com/users/kixxauth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kixxauth/subscriptions","organizations_url":"https://api.github.com/users/kixxauth/orgs","repos_url":"https://api.github.com/users/kixxauth/repos","events_url":"https://api.github.com/users/kixxauth/events{/privacy}","received_events_url":"https://api.github.com/users/kixxauth/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-14T10:50:28Z","updated_at":"2016-06-26T15:05:15Z","closed_at":"2016-06-26T15:05:15Z","body":"If a message is sent without a payload, the inprocessTransport chokes on it here:\r\n\r\n```JS\r\nutils.extend(InprocessTransport.prototype, {\r\n\twrite: function (message) {\r\n\t\tvar pattern = message.pattern;\r\n\t\tvar payload = JSON.parse(JSON.stringify(message.payload));\r\n\r\n\t\tif (this.handler) {\r\n\t\t\t// This is a Command or Request Channel\r\n\t\t\treturn this.handler({pattern: pattern, payload: payload})\r\n\t\t\t\t.catch(errors.NoTransportError, errors.NoHandlerError, function (err) {\r\n\t\t\t\t\treturn Promise.reject(new errors.NotFoundError(err.message));\r\n\t\t\t\t});\r\n\t\t}\r\n\t\t// This is an Event Channel\r\n\t\tthis.emit('data', {pattern: pattern, payload: payload});\r\n\t\treturn this;\r\n\t},\r\n\r\n\tsetHandler: function (handler) {\r\n\t\tthis.handler = handler;\r\n\t}\r\n});\r\n```\r\n\r\nSpecifically `var payload = JSON.parse(JSON.stringify(message.payload));`\r\n\r\nThe channel should set a default payload of `{}` to prevent this from happening."}}
{"actor":{"display_login":"kixxauth"}}