Skip to content

Commit c2fa24a

Browse files
author
Jessica Wang
committed
CLOUDSTACK-6154: UI > compute offerings > memory field > check if value is undefined before converting it.
1 parent 92064e3 commit c2fa24a

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎ui/scripts/configuration.js‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,10 @@
522522
memory: {
523523
label: 'label.memory.mb',
524524
converter: function(args) {
525-
return cloudStack.converters.convertBytes(args * 1024 * 1024);
525+
if (args == undefined)
526+
return '';
527+
else
528+
return cloudStack.converters.convertBytes(args * 1024 * 1024);
526529
}
527530
},
528531
networkrate: {
@@ -1038,7 +1041,10 @@
10381041
memory: {
10391042
label: 'label.memory.mb',
10401043
converter: function(args) {
1041-
return cloudStack.converters.convertBytes(args * 1024 * 1024);
1044+
if (args == undefined)
1045+
return '';
1046+
else
1047+
return cloudStack.converters.convertBytes(args * 1024 * 1024);
10421048
}
10431049
},
10441050
networkrate: {

‎ui/scripts/sharedFunctions.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,9 @@ var roleTypeDomainAdmin = "2";
900900

901901
cloudStack.converters = {
902902
convertBytes: function(bytes) {
903+
if (bytes == undefined)
904+
return '';
905+
903906
if (bytes < 1024 * 1024) {
904907
return (bytes / 1024).toFixed(2) + " KB";
905908
} else if (bytes < 1024 * 1024 * 1024) {

0 commit comments

Comments
 (0)