diff --git a/nodecg-io-core/dashboard/serviceInstance.ts b/nodecg-io-core/dashboard/serviceInstance.ts index 58f8c722a..d5de57274 100644 --- a/nodecg-io-core/dashboard/serviceInstance.ts +++ b/nodecg-io-core/dashboard/serviceInstance.ts @@ -33,7 +33,10 @@ const instancePreset = document.getElementById("instancePreset"); const instanceNameField = document.getElementById("instanceNameField"); const instanceEditButtons = document.getElementById("instanceEditButtons"); const instanceCreateButton = document.getElementById("instanceCreateButton"); -const instanceMonaco = document.getElementById("instanceMonaco")!; +const instanceMonaco = document.getElementById("instanceMonaco"); +if (instanceMonaco === null) { + throw new Error("Couldn't find instanceMonaco"); +} const editor = monaco.editor.create(instanceMonaco, { theme: "vs-dark", }); diff --git a/services/nodecg-io-debug/dashboard/debug-helper.ts b/services/nodecg-io-debug/dashboard/debug-helper.ts index 78d254bd8..6533c2ef5 100644 --- a/services/nodecg-io-debug/dashboard/debug-helper.ts +++ b/services/nodecg-io-debug/dashboard/debug-helper.ts @@ -71,9 +71,14 @@ setHandler("#list_list_send", "onclick", () => { }); // JSON +const instanceMonaco = document.getElementById("instanceMonaco"); +if (instanceMonaco === null) { + throw new Error("Could not find instanceMonaco"); +} + const jsonCode = JSON.stringify({ data: 42 }, null, 4); const model = monaco.editor.createModel(jsonCode, "json"); -const debugMonacoEditor = monaco.editor.create(document.getElementById("instanceMonaco")!, { +const debugMonacoEditor = monaco.editor.create(instanceMonaco, { model: model, theme: "vs-dark", });