correct localise call, fallback to err if no err.message is available, protected message service against invalid items, fixes #5891

This commit is contained in:
Johannes Rieken
2016-04-27 14:33:42 +02:00
parent 4858b5910d
commit 73b97a0642
2 changed files with 4 additions and 2 deletions

View File

@@ -28,9 +28,11 @@ export class ExtHostMessageService {
let command = commands[handle];
if (typeof command === 'string') {
items.push({ title: command, handle, isCloseAffordance: false });
} else {
} else if (typeof command === 'object') {
let {title, isCloseAffordance} = command;
items.push({ title, isCloseAffordance, handle });
} else {
console.warn('Invalid message item:', command);
}
}