From bdd23d065ba51e69bf5591b97840aa17cda0c171 Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 21 May 2015 13:10:34 +0400 Subject: [PATCH] content-type can be undefined --- plugins/c9.core/http-xhr.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/c9.core/http-xhr.js b/plugins/c9.core/http-xhr.js index 0865626a..3144aaff 100644 --- a/plugins/c9.core/http-xhr.js +++ b/plugins/c9.core/http-xhr.js @@ -106,9 +106,8 @@ define(function(require, module, exports) { }; var data = xhr.responseText; - if ((options.overrideMimeType || res.headers["content-type"]) - .indexOf("application/json") === 0 - ) { + var contentType = options.overrideMimeType || res.headers["content-type"] || ""; + if (contentType.indexOf("application/json") === 0) { try { data = JSON.parse(data); } catch (e) {