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

Commit

Permalink
Merge pull request #67 from bluemaex/patch-1
Browse files Browse the repository at this point in the history
Avoid crash when measure time is too far in the past
  • Loading branch information
bryanmikaelian authored Mar 6, 2017
2 parents e4752f8 + f2ee26c commit fab715c
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 fab715c

Please sign in to comment.