Skip to content

Commit

Permalink
fix: JSON service output is not correctly displayed after multiple ex…
Browse files Browse the repository at this point in the history
…ecutions. Fix #37
  • Loading branch information
stefan-lacatus committed Mar 16, 2022
1 parent 33de8f5 commit 94cc92b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/editors/basicCodeEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ export class MonacoCodeEditor {
* Gets the current text in the monaco editor
*/
public getValue(): string {
return this.monacoEditor.getModel().getValue(monaco.editor.EndOfLinePreference.LF);
// This may get called when no model is initialized. In that case, return an empty string
return this.monacoEditor.getModel()?.getValue(monaco.editor.EndOfLinePreference.LF) || "";
}

/**
Expand Down

0 comments on commit 94cc92b

Please sign in to comment.