Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
check if variable is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemaex authored Mar 4, 2017
1 parent e4752f8 commit f2ee26c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/librato.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand Down

0 comments on commit f2ee26c

Please sign in to comment.