forked from github/server
report missing itemtype before crashing
This commit is contained in:
parent
7038b021de
commit
d388a94f36
|
@ -405,17 +405,20 @@ void read_items(struct storage *store, item ** ilist)
|
|||
const item_type *itype;
|
||||
int i;
|
||||
READ_STR(store, ibuf, sizeof(ibuf));
|
||||
if (!strcmp("end", ibuf))
|
||||
if (!strcmp("end", ibuf)) {
|
||||
break;
|
||||
}
|
||||
itype = it_find(ibuf);
|
||||
READ_INT(store, &i);
|
||||
if (i <= 0) {
|
||||
log_error("data contains an entry with %d %s\n", i, itype->rtype->_name[1]);
|
||||
} else {
|
||||
assert(itype != NULL);
|
||||
if (itype != NULL) {
|
||||
i_change(ilist, itype, i);
|
||||
} else {
|
||||
log_error("data contains unknown item type %s.\n", ibuf);
|
||||
}
|
||||
assert(itype != NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue