From c385734cc41c90ac87788ee99d44caa8d879b5fa Mon Sep 17 00:00:00 2001
From: Lloyd Hilaiel <lloyd@hilaiel.com>
Date: Mon, 9 Jan 2012 09:41:19 -0700
Subject: [PATCH] (loadgen) fix regression, when connections fail loadgen
 should not crash

---
 lib/load_gen/common.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/load_gen/common.js b/lib/load_gen/common.js
index 0a7cf6178..cd94b5ade 100644
--- a/lib/load_gen/common.js
+++ b/lib/load_gen/common.js
@@ -67,7 +67,7 @@ exports.genAssertionAndVerify = function(cfg, user, ctx, email, audience, cb) {
     try {
       if (!typeof JSON.parse(r.body) === 'object') throw 'bogus response';
     } catch(e) {
-      return cb(e.toString() + " - " + r.body);
+      return cb(e.toString() + (r ? (" - " + r.body) : ""));
     }
 
     var assertion = crypto.getAssertion({
-- 
GitLab