{"comment":{"url":"https://api.github.com/repos/holidayextras/nodemailer-sendgrid-transport/comments/16360494","html_url":"https://github.com/holidayextras/nodemailer-sendgrid-transport/commit/393196e49df466d020a6ce2dfb5c1c87543db72a#commitcomment-16360494","id":16360494,"user":{"login":"vinicius0026","id":3792147,"avatar_url":"https://avatars.githubusercontent.com/u/3792147?v=3","gravatar_id":"","url":"https://api.github.com/users/vinicius0026","html_url":"https://github.com/vinicius0026","followers_url":"https://api.github.com/users/vinicius0026/followers","following_url":"https://api.github.com/users/vinicius0026/following{/other_user}","gists_url":"https://api.github.com/users/vinicius0026/gists{/gist_id}","starred_url":"https://api.github.com/users/vinicius0026/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinicius0026/subscriptions","organizations_url":"https://api.github.com/users/vinicius0026/orgs","repos_url":"https://api.github.com/users/vinicius0026/repos","events_url":"https://api.github.com/users/vinicius0026/events{/privacy}","received_events_url":"https://api.github.com/users/vinicius0026/received_events","type":"User","site_admin":false},"position":8,"line":118,"path":"src/sendgrid-transport.js","commit_id":"393196e49df466d020a6ce2dfb5c1c87543db72a","created_at":"2016-02-26T19:14:23Z","updated_at":"2016-02-26T19:14:23Z","body":"This would break if `email.categories` is a `string`. You could test with `Array.isArray(email.categories)` for being sure that forEach would work (even if the array is empty). If categories is a `string` it could be passed directly to `sendgridEmail.addCategory`."}}