cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [32/50] git commit: updated refs/heads/saml2 to 09da909
Date Sat, 16 Aug 2014 10:56:03 GMT
Handle case where no storage tags exist yet


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a698daaf
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a698daaf
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a698daaf

Branch: refs/heads/saml2
Commit: a698daafffd2358efbb12514d98fba82ebf8573d
Parents: 6115a90
Author: Mike Tutkowski <mike.tutkowski@solidfire.com>
Authored: Wed Aug 13 10:53:37 2014 -0600
Committer: Mike Tutkowski <mike.tutkowski@solidfire.com>
Committed: Wed Aug 13 10:54:10 2014 -0600

----------------------------------------------------------------------
 ui/scripts/system.js | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a698daaf/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index b658301..5c49a1a 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -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);
                                                 }
                                             });


Mime
View raw message