Skip to content

Commit a7fbd19

Browse files
committed
add check
1 parent 5e0a429 commit a7fbd19

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

editor.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ namespace microcode {
283283
x: Screen.LEFT_EDGE + 52,
284284
y: 8,
285285
onClick: () => {
286-
if (isProgramRunning()) this.stopProgram()
286+
this.stopProgram()
287287
},
288288
})
289289
this.pageBtn = new Button({
@@ -310,12 +310,14 @@ namespace microcode {
310310
}
311311

312312
public stopProgram() {
313-
stopProgram()
314-
this.runBtn.buildSprite(icondb.run)
315-
this.stopBtn.buildSprite(icondb.stopDisabled)
316-
this.dirty = true
317-
basic.showIcon(IconNames.No, 100)
318-
basic.clearScreen()
313+
if (isProgramRunning()) {
314+
stopProgram()
315+
this.runBtn.buildSprite(icondb.run)
316+
this.stopBtn.buildSprite(icondb.stopDisabled)
317+
this.dirty = true
318+
basic.showIcon(IconNames.No, 100)
319+
basic.clearScreen()
320+
}
319321
}
320322

321323
private configureP1Keys() {

0 commit comments

Comments
 (0)