Skip to content

Commit f97f9c7

Browse files
committed
small fixes
1 parent 5b09d19 commit f97f9c7

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

lib/routes/vm.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,12 @@ exports.templateList = function(req, res) {
341341

342342
var output = [];
343343
for (var i = 0; i < templates.length; i++) {
344-
output.push({
345-
'id': templates[i].ID,
346-
'name': templates[i].NAME
347-
});
344+
if (templates[i] !== undefined) {
345+
output.push({
346+
'id': templates[i].ID,
347+
'name': templates[i].NAME
348+
});
349+
}
348350
}
349351
return res.status(200).json({
350352
'templates': output
@@ -363,8 +365,10 @@ exports.imageList = function(req, res) {
363365

364366
var output = [];
365367
for (var i = 0; i < images.length; i++) {
366-
if (images[i].TYPE == '0') {
367-
output.push(images[i].NAME);
368+
if (images[i] !== undefined) {
369+
if (images[i].TYPE == '0') {
370+
output.push(images[i].NAME);
371+
}
368372
}
369373
}
370374

@@ -586,4 +590,4 @@ function getVM(req, vmID, callback) {
586590
}, function(err, doc) {
587591
callback(err, doc);
588592
});
589-
}
593+
}

static/assets/js/views/vmadd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ window.VMAddView = Backbone.View.extend({
4444
}
4545
modem('POST', 'vm',
4646
function(json) {
47-
var smsg = ['VM crated', 'VM criada', 'VM creada'];
47+
var smsg = ['VM created', 'VM criada', 'VM creada'];
4848
showSuccess(smsg[getlang()]);
4949
app.navigate('/vm/info/'+json.id, {
5050
trigger: true

0 commit comments

Comments
 (0)