summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/msg.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index 0d01f5e1..0ee78ae0 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -3500,6 +3500,14 @@ rsRetVal MsgAppendFields(msg_t *pMsg, struct templateEntry *pTpe,
}
}
} else {
+ /* FIXME: this performs a duplicate lookup, which wastes
+ time. */
+ if(pTpe->data.field.options.bOptionalField
+ && (pMsg->event == NULL
+ || ee_getEventField(pMsg->event,
+ pTpe->data.field.propName) == NULL))
+ FINALIZE; /* Nothing to do */
+
CHKiRet(FBSensureSpace(state));
dst = state->fields + state->nextField;