diff --git a/src/vs/editor/common/services/modelServiceImpl.ts b/src/vs/editor/common/services/modelServiceImpl.ts index 8c8cb886d8d..c1249a657d2 100644 --- a/src/vs/editor/common/services/modelServiceImpl.ts +++ b/src/vs/editor/common/services/modelServiceImpl.ts @@ -204,9 +204,11 @@ export class ModelServiceImpl implements IModelService { this._configurationService = configurationService; let readDefaultEOL = (config:any) => { - if (config.files.eol === '\r\n') { + const eol = config.files && config.files.eol; + + if (eol === '\r\n') { this._defaultEOL = editorCommon.DefaultEndOfLine.CRLF; - } else if (config.files.eol === '\n') { + } else if (eol === '\n') { this._defaultEOL = editorCommon.DefaultEndOfLine.LF; } };