summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/strgen/strgen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index 1048ac09c..22450bddf 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -399,8 +399,8 @@ static void EmitGender(char *buf, int value)
if (!ParseRelNum(&buf, &argidx, &offset)) {}
const CmdStruct *cmd = _cur_pcs.cmd[argidx];
- if ((cmd->flags & C_GENDER) == 0) {
- error("Command '%s' can't have a gender", cmd->cmd);
+ if (cmd == NULL || (cmd->flags & C_GENDER) == 0) {
+ error("Command '%s' can't have a gender", cmd == NULL ? "<empty>" : cmd->cmd);
}
for (nw = 0; nw < MAX_NUM_GENDER; nw++) {