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

Commit

Permalink
Avoid crashing on new procpath() values
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceManiac committed May 9, 2020
1 parent c28a1e0 commit 4010d2c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions byond-extools/src/debug_server/debug_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,12 @@ nlohmann::json value_to_text(Value val)
literal = { { "resource", Core::stringify(val) } };
break;
case DataType::PROCPATH: {
Core::Proc& p = Core::get_proc(val.value);
literal = { { "proc", p.name } };
if (val.value < Core::get_all_procs().size()) {
Core::Proc& p = Core::get_proc(val.value);
literal = { { "proc", p.name } };
} else {
literal = { { "ref", (val.type << 24) | val.value } };
}
break;
}
default:
Expand Down

0 comments on commit 4010d2c

Please sign in to comment.