Skip to content

Commit f1ff4a1

Browse files
committed
Fix serial connection not closing when processor becomes invalid
1 parent 67a35d3 commit f1ff4a1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mod/src/main/kotlin/gay/object/mlogv32/ProcessorAccess.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,11 @@ data class SerialRequest(
439439
var overflowCount = 0
440440

441441
val fromUart = runOnMainThread {
442+
if (!processor.build.isValid) {
443+
Log.info("ProcessorAccess build invalid, closing serial connection.")
444+
return@runOnMainThread null
445+
}
446+
442447
if (!processor.powerSwitch.enabled) {
443448
when {
444449
disconnectOnHalt -> return@runOnMainThread null

0 commit comments

Comments
 (0)