You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pr...@apache.org on 2012/11/27 13:01:56 UTC

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

Updated Branches:
  refs/heads/master 2149b82b3 -> ed5bd846e


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/master
Commit: ed5bd846e8d44e5a3c1c9568babb73892dcc763a
Parents: 2149b82
Author: Pranav Saxena <pr...@citrix.com>
Authored: Tue Nov 27 17:29:50 2012 +0530
Committer: Pranav Saxena <pr...@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
+             });
+ 
+           }
+
+          }
         });
       },