mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
GH-606: Output nulls into json data if a field isn't set
This commit is contained in:
parent
95489d52d8
commit
d4c394b72a
6 changed files with 21 additions and 2 deletions
|
@ -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 )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue