From 35704cd55b6f3451c125835605739a7f092d39a3 Mon Sep 17 00:00:00 2001 From: James Kerr Date: Mon, 19 Apr 2021 10:03:53 -0700 Subject: [PATCH] Check if 'of' is null --- zealot/enhancers/zngToZeek.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zealot/enhancers/zngToZeek.ts b/zealot/enhancers/zngToZeek.ts index 058e2928f7..609ebe2661 100644 --- a/zealot/enhancers/zngToZeek.ts +++ b/zealot/enhancers/zngToZeek.ts @@ -37,9 +37,9 @@ function replaceColumn(c: zjson.Column): zjson.Column { if (c.type == "array" || c.type == "set") { return {...c, of: replaceTypes(c.of)} } else if (c.type == "union") { - return {...c, of: c.of.map(replaceTypes)} + return {...c, of: (c.of || []).map(replaceTypes)} } else if (c.type == "record") { - return {...c, of: c.of.map(replaceColumn)} + return {...c, of: (c.of || []).map(replaceColumn)} } else { return {...c, type: getZeekPrimitive(c.type)} }