mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Avoid NPE
This commit is contained in:
parent
7e97f98c41
commit
5133a79e40
|
@ -33,13 +33,17 @@ export class MainThreadTextEditorProperties {
|
|||
}
|
||||
|
||||
private static _readSelectionsFromCodeEditor(previousProperties: MainThreadTextEditorProperties, codeEditor: ICodeEditor): Selection[] {
|
||||
let result: Selection[] = null;
|
||||
if (codeEditor) {
|
||||
return codeEditor.getSelections();
|
||||
result = codeEditor.getSelections();
|
||||
}
|
||||
if (previousProperties) {
|
||||
return previousProperties.selections;
|
||||
if (!result && previousProperties) {
|
||||
result = previousProperties.selections;
|
||||
}
|
||||
return [new Selection(1, 1, 1, 1)];
|
||||
if (!result) {
|
||||
result = [new Selection(1, 1, 1, 1)];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static _readOptionsFromCodeEditor(previousProperties: MainThreadTextEditorProperties, model: ITextModel, codeEditor: ICodeEditor): IResolvedTextEditorConfiguration {
|
||||
|
|
Loading…
Reference in a new issue