Use ?. in a few more places

This commit is contained in:
Matt Bierner committed 2019-10-22 16:16:26 -07:00
1 parent 5f43e66c4d
commit 8fcd2e659e
2 files changed
+3 -5

No files matched your search

@@ -152,7 +152,7 @@ export class EditorService extends Disposable implements EditorServiceImpl {
for (const handler of this.openEditorHandlers) {
const result = handler(event.editor, event.options, group);
const override = result ? result.override : undefined;
const override = result?.override;
if (override) {
event.prevent((() => override.then(editor => withNullAsUndefined(editor))));
break;
@@ -161,9 +161,7 @@ export class EditorService extends Disposable implements EditorServiceImpl {
}
get activeControl(): IVisibleEditor | undefined {
const activeGroup = this.editorGroupService.activeGroup;
return activeGroup ? activeGroup.activeControl : undefined;
return this.editorGroupService.activeGroup?.activeControl;
}
get activeTextEditorWidget(): ICodeEditor | IDiffEditor | undefined {
@@ -482,7 +482,7 @@ export class HistoryService extends Disposable implements IHistoryService {
}
private handleEditorEventInHistory(editor?: IBaseEditor): void {
const input = editor ? editor.input : undefined;
const input = editor?.input;
// Ensure we have at least a name to show and not configured to exclude input
if (!input || !input.getName() || !this.include(input)) {