Skip to content

Commit

Permalink
microsoft#67076 fix strict null check
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Feb 22, 2019
1 parent 1ebd312 commit 20c849c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/vs/editor/contrib/gotoError/gotoError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ export class MarkerController implements editorCommon.IEditorContribution {
this._markerService.onMarkerChanged(this._onMarkerChanged, this, this._disposeOnClose);

const actions = [
new Action(PrevMarkerAction.ID, PrevMarkerAction.LABEL, 'show-previous-problem octicon octicon-chevron-up', this._model.canNavigate(), async () => this._model.move(false, true)),
new Action(NextMarkerAction.ID, NextMarkerAction.LABEL, 'show-next-problem octicon octicon-chevron-down', this._model.canNavigate(), async () => this._model.move(true, true))
new Action(PrevMarkerAction.ID, PrevMarkerAction.LABEL, 'show-previous-problem octicon octicon-chevron-up', this._model.canNavigate(), async () => { if (this._model) { this._model.move(false, true); } }),
new Action(NextMarkerAction.ID, NextMarkerAction.LABEL, 'show-next-problem octicon octicon-chevron-down', this._model.canNavigate(), async () => { if (this._model) { this._model.move(true, true); } })
];
this._widget = new MarkerNavigationWidget(this._editor, actions, this._themeService);
this._widgetVisible.set(true);
Expand Down
5 changes: 4 additions & 1 deletion src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,10 @@ export class MarkerNavigationWidget extends PeekViewWidget {
const detail = markerCount > 1
? nls.localize('problems', "{0} of {1} problems", markerIdx, markerCount)
: nls.localize('change', "{0} of {1} problem", markerIdx, markerCount);
this.setTitle(basename(this.editor.getModel().uri), detail);
const model = this.editor.getModel();
if (model) {
this.setTitle(basename(model.uri), detail);
}

this.editor.revealPositionInCenter(position, ScrollType.Smooth);

Expand Down

0 comments on commit 20c849c

Please sign in to comment.