getConfiguration should not crash when section denotes a value, #1396

This commit is contained in:
Johannes Rieken
2016-06-08 11:56:09 +02:00
parent 2de9e4621f
commit e8ddfed2cc
2 changed files with 13 additions and 3 deletions

View File

@@ -41,9 +41,14 @@ export class ExtHostConfiguration {
? ExtHostConfiguration._lookUp(section, this._config)
: this._config;
let result: any;
if (typeof config !== 'object') {
// this catches missing config and accessing values
result = {};
} else {
result = clone(config);
}
let result = config ? clone(config) : {};
// result = Object.freeze(result);
result.has = function(key: string): boolean {
return typeof ExtHostConfiguration._lookUp(key, config) !== 'undefined';
};