GH-606: Output nulls into json data if a field isn't set

This commit is contained in:
Tim Wojtulewicz 2019-09-27 14:12:48 -07:00
parent 95489d52d8
commit d4c394b72a
6 changed files with 21 additions and 2 deletions

View file

@ -73,6 +73,10 @@ threading::Value* JSON::ParseValue(const string& s, const string& name, TypeTag
ZeekJson JSON::BuildJSON(Value* val, const string& name) const
{
// If the value wasn't set, return a nullptr. This will get turned into a 'null' in the json output.
if ( ! val->present )
return nullptr;
ZeekJson j;
switch ( val->type )
{