Can we return null in javascript enrichment

can we return null in javascript enrichment . i just want to validate app id don’t want any enrichment

You can return an empty array as a safer change: return [].

function process(event) {
var appId = event.getApp_id();

if (appId != “something”) {
throw "Server-side event has invalid app_id: " + appId;
return ;

it will give error
":{“timestamp”:“2021-09-29T11:10:00.536670108Z”,“messages”:[{“enrichment”:{“schemaKey”:“iglu:com.snowplowanalytics.snowplow/javascript_script_config/jsonschema/1-0-0”,“identifier”:“Javascript enrichment”},“message”:{“error”:“Error compiling JavaScript function: [Cannot invoke “javax.script.Compilable.compile(String)” because the return value of “com.snowplowanalytics.snowplow.enrich.common.enrichments.registry.JavascriptScriptEnrichment.engine()” is null]”}}]},

Closing as duplicate of Unable to run javascript enrichment in PUBSUB Enrich

Please don’t spam the forum with multiple topics on the same issue