1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix crash in MonacoEditor

- The crash reported was never observed

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-06-17 11:50:34 -04:00
parent bcd889999d
commit 720eda2bb1

View File

@ -94,7 +94,8 @@ class NonInjectedMonacoEditor extends React.Component<MonacoEditorProps & Depend
const { language, value } = this.props; const { language, value } = this.props;
return editor.createModel(value, language, uri); // NOTE: if for some reason `value` is not typeof "string" then the following line can throw.
return editor.createModel(String(value), language, uri);
} }
@computed get options(): editor.IStandaloneEditorConstructionOptions { @computed get options(): editor.IStandaloneEditorConstructionOptions {