From 44ceff422477411107c0355d09ad2b0a9facfed0 Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Fri, 25 Jan 2013 16:42:42 +0530 Subject: [PATCH] CLOUDSTACK-1064:A type error occurs when trying to add account/register template: this is because of accounts conext being undefined --- ui/scripts/accounts.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index 59e9d8bbd15..4c327ee759b 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -642,12 +642,16 @@ }, vmLimit: { label: 'label.instance.limits', - isEditable: function(context) { + isEditable: function(context) { + + if(context.accounts == undefined) + return false; + else { if (context.accounts[0].accounttype == roleTypeUser || context.accounts[0].accounttype == roleTypeDomainAdmin) //updateResourceLimits is only allowed on account whose type is user or domain-admin return true; else return false; - } + } } }, ipLimit: { label: 'label.ip.limits',