File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
packages/app/src/app/overmind/effects/vscode Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,11 @@ export class VSCodeEffect {
250250 }
251251
252252 public updateOptions ( options : { readOnly : boolean } ) {
253- this . editorApi . getActiveCodeEditor ( ) . updateOptions ( options ) ;
253+ const editor = this . editorApi . getActiveCodeEditor ( ) ;
254+
255+ if ( editor ) {
256+ editor . updateOptions ( options ) ;
257+ }
254258 }
255259
256260 public updateUserSelections ( userSelections : EditorSelection [ ] ) {
@@ -267,9 +271,7 @@ export class VSCodeEffect {
267271 public setReadOnly ( enabled : boolean ) {
268272 this . readOnly = enabled ;
269273
270- const activeEditor = this . editorApi . getActiveCodeEditor ( ) ;
271-
272- activeEditor . updateOptions ( { readOnly : enabled } ) ;
274+ this . updateOptions ( { readOnly : enabled } ) ;
273275 }
274276
275277 public updateLayout = ( width : number , height : number ) => {
You can’t perform that action at this time.
0 commit comments