From da202e46cbdaa157fc527c3a5c0fe1912a92673a Mon Sep 17 00:00:00 2001 From: Maurits van Riezen Date: Fri, 12 Apr 2024 11:19:35 +0200 Subject: [PATCH] don't attempt to draw the register if it doesn't exist --- src/scripts/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/main.ts b/src/scripts/main.ts index aaf272a..3e78b9c 100644 --- a/src/scripts/main.ts +++ b/src/scripts/main.ts @@ -147,7 +147,7 @@ function update_ui_for_program(o: AnyTypeProgramState) { stack_div.innerText = o.stacks.map(i => i.contents.map(j => o.number_implementation.toString(j)).join(' ')).join('\n'); cursor_postion_box.textContent = JSON.stringify(o.cursor); - register_box.textContent = o.stacks.map(i => o.number_implementation.toString(i.register)).join(', '); + register_box.textContent = o.stacks.map(i => i.register && o.number_implementation.toString(i.register)).join(', '); } let program_state: AnyTypeProgramState = {