Handle case where no storage tags exist yet

This commit is contained in:
Mike Tutkowski 2014-08-13 10:53:37 -06:00
parent 6115a90c70
commit a698daafff

View File

@ -16897,18 +16897,25 @@
dataType: "json", dataType: "json",
success: function (json) { success: function (json) {
var item = json.liststoragetagsresponse.storagetag; var item = json.liststoragetagsresponse.storagetag;
var tags = $.map(item, function (tag) { var tags = [];
return {
id: tag.name, if (item != null)
name: tag.name {
}; tags = $.map(item, function (tag) {
}); return {
id: tag.name,
name: tag.name
};
});
}
args.response.success({ args.response.success({
data: tags data: tags
}); });
}, },
error: function (XMLHttpResponse) { error: function (XMLHttpResponse) {
var errorMsg = parseXMLHttpResponse(XMLHttpResponse); var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
args.response.error(errorMsg); args.response.error(errorMsg);
} }
}); });