diff --git a/lib/librato.js b/lib/librato.js index de1c672..800d41c 100644 --- a/lib/librato.js +++ b/lib/librato.js @@ -104,7 +104,7 @@ var post_payload = function(options, proto, payload, retry) if (/^application\/json/.test(res.headers['content-type'])) { var meta = JSON.parse(d), re = /'([^']+)' is a \S+, but was submitted as different type/; - if (meta.errors && meta.errors.params && meta.errors.params.type.length) { + if (meta.errors && meta.errors.params && meta.errors.params.type && meta.errors.params.type.length) { var fields = meta.errors.params.type; for (var i=0; i < fields.length; i++) { var match = re.exec(fields[i]),