mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 18:43:26 +01:00
Handle case where no storage tags exist yet
This commit is contained in:
parent
6115a90c70
commit
a698daafff
@ -16897,18 +16897,25 @@
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
var item = json.liststoragetagsresponse.storagetag;
|
||||
var tags = $.map(item, function (tag) {
|
||||
return {
|
||||
id: tag.name,
|
||||
name: tag.name
|
||||
};
|
||||
});
|
||||
var tags = [];
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
tags = $.map(item, function (tag) {
|
||||
return {
|
||||
id: tag.name,
|
||||
name: tag.name
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
args.response.success({
|
||||
data: tags
|
||||
});
|
||||
},
|
||||
error: function (XMLHttpResponse) {
|
||||
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||
|
||||
args.response.error(errorMsg);
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user