Skip to content
This repository was archived by the owner on Apr 10, 2021. It is now read-only.

Commit 4010d2c

Browse files
committed
Avoid crashing on new procpath() values
1 parent c28a1e0 commit 4010d2c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

byond-extools/src/debug_server/debug_server.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,12 @@ nlohmann::json value_to_text(Value val)
445445
literal = { { "resource", Core::stringify(val) } };
446446
break;
447447
case DataType::PROCPATH: {
448-
Core::Proc& p = Core::get_proc(val.value);
449-
literal = { { "proc", p.name } };
448+
if (val.value < Core::get_all_procs().size()) {
449+
Core::Proc& p = Core::get_proc(val.value);
450+
literal = { { "proc", p.name } };
451+
} else {
452+
literal = { { "ref", (val.type << 24) | val.value } };
453+
}
450454
break;
451455
}
452456
default:

0 commit comments

Comments
 (0)