[gamecode] Check for null edict before printing number

Avoids segfault during double-verbose disassembly of progs code that
uses entities.
This commit is contained in:
Bill Currie 2021-07-24 18:04:57 +09:00
parent 7868936b96
commit 86cf7fbecd

View file

@ -1237,11 +1237,13 @@ pr_debug_entity_view (qfot_type_t *type, pr_type_t *value, void *_data)
if (pr->pr_edicts) {
edict_t *edict = PROG_TO_EDICT (pr, value->entity_var);
if (edict) {
dasprintf (dstr, "entity %d", NUM_FOR_BAD_EDICT (pr, edict));
} else {
dasprintf (dstr, "entity [%x]",value->entity_var);
return;
}
}
dasprintf (dstr, "entity [%x]", value->entity_var);
}
static void
pr_debug_field_view (qfot_type_t *type, pr_type_t *value, void *_data)