forked from github/server
crash more gracefully on missing description
This commit is contained in:
parent
231f9bb39a
commit
553cf23e9e
|
@ -2064,6 +2064,7 @@ static void eval_spell(struct opstack **stack, const void *userdata)
|
||||||
const struct spell *sp = (const struct spell *)opop(stack).v;
|
const struct spell *sp = (const struct spell *)opop(stack).v;
|
||||||
const char *c =
|
const char *c =
|
||||||
sp ? spell_name(sp, f->locale) : LOC(f->locale, "an_unknown_spell");
|
sp ? spell_name(sp, f->locale) : LOC(f->locale, "an_unknown_spell");
|
||||||
|
assert(c || !"spell without description!");
|
||||||
size_t len = strlen(c);
|
size_t len = strlen(c);
|
||||||
variant var;
|
variant var;
|
||||||
|
|
||||||
|
@ -2077,6 +2078,7 @@ static void eval_curse(struct opstack **stack, const void *userdata)
|
||||||
const struct curse_type *sp = (const struct curse_type *)opop(stack).v;
|
const struct curse_type *sp = (const struct curse_type *)opop(stack).v;
|
||||||
const char *c =
|
const char *c =
|
||||||
sp ? curse_name(sp, f->locale) : LOC(f->locale, "an_unknown_curse");
|
sp ? curse_name(sp, f->locale) : LOC(f->locale, "an_unknown_curse");
|
||||||
|
assert(c || !"spell effect without description!");
|
||||||
size_t len = strlen(c);
|
size_t len = strlen(c);
|
||||||
variant var;
|
variant var;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue