Check xhr.responseText is set before trying to send it to $.byteLength

Bug: T125399
Change-Id: I09881fe8b6db7d95e32732129d043c4a13fa7a9a
This commit is contained in:
Alex Monk 2016-02-01 16:45:19 +00:00 committed by Jforrester
parent 9ec0705a2b
commit 9808d04bfe

View file

@ -1132,10 +1132,11 @@ ve.init.mw.ArticleTarget.prototype.tryWithPreparedCacheKey = function ( doc, opt
return jqxhr;
},
function ( errorName, errorObject ) {
var eventData;
if ( errorObject && errorObject.xhr ) {
var responseText = ve.getProp( errorObject, 'xhr', 'responseText' ),
eventData;
if ( responseText ) {
eventData = {
bytes: $.byteLength( errorObject.xhr.responseText ),
bytes: $.byteLength( responseText ),
duration: ve.now() - start
};