Skip to content

Commit a698daa

Browse files
author
Mike Tutkowski
committed
Handle case where no storage tags exist yet
1 parent 6115a90 commit a698daa

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

‎ui/scripts/system.js‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16897,18 +16897,25 @@
1689716897
dataType: "json",
1689816898
success: function (json) {
1689916899
var item = json.liststoragetagsresponse.storagetag;
16900-
var tags = $.map(item, function (tag) {
16901-
return {
16902-
id: tag.name,
16903-
name: tag.name
16904-
};
16905-
});
16900+
var tags = [];
16901+
16902+
if (item != null)
16903+
{
16904+
tags = $.map(item, function (tag) {
16905+
return {
16906+
id: tag.name,
16907+
name: tag.name
16908+
};
16909+
});
16910+
}
16911+
1690616912
args.response.success({
1690716913
data: tags
1690816914
});
1690916915
},
1691016916
error: function (XMLHttpResponse) {
1691116917
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
16918+
1691216919
args.response.error(errorMsg);
1691316920
}
1691416921
});

0 commit comments

Comments
 (0)