incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prachida...@apache.org
Subject [19/50] [abbrv] git commit: CLOUDSTACK-550:Getting TypeError: items is undefined error in UI when we click on Instances tab while no instances are launched yet:Handling the null case for items
Date Thu, 29 Nov 2012 00:01:18 GMT
CLOUDSTACK-550:Getting TypeError: items is undefined error in UI when we click on Instances
tab while no instances are launched yet:Handling the null case for items


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

Branch: refs/heads/api_refactoring
Commit: ed5bd846e8d44e5a3c1c9568babb73892dcc763a
Parents: 2149b82
Author: Pranav Saxena <pranav.saxena@citrix.com>
Authored: Tue Nov 27 17:29:50 2012 +0530
Committer: Pranav Saxena <pranav.saxena@citrix.com>
Committed: Tue Nov 27 17:29:50 2012 +0530

----------------------------------------------------------------------
 ui/scripts/instances.js |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed5bd846/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index e638637..3ef00df 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -203,6 +203,7 @@
           data: data,          
           success: function(json) {
             var items = json.listvirtualmachinesresponse.virtualmachine;
+            if(items != null) {
             var i=0;
             for( i=0;i< items.length;i++){
               if(items[i].state == 'Expunging')
@@ -217,6 +218,15 @@
             }
            }
           }
+          else {
+             args.response.success({
+              actionFilter: vmActionfilter,
+              data: items
+             });
+ 
+           }
+
+          }
         });
       },
 


Mime
View raw message