Match maker custom code error

i have write custom code for match making which is given in documents. but i am getting bellow error.

{“level”:“error”,“ts”:“2020-12-18T15:21:14.643Z”,“msg”:“Error running Matchmaker Matched hook.”,“error”:“Error running runtime Matchmaker Matched hook: /nakama/data/modules/make_match.lua:7: attempt to index a non-table object(nil) with key ‘presence’\nstack traceback:\n\t/nakama/data/modules/make_match.lua:7: in main chunk\n\t[G]: ?”,“stacktrace”:“github.com/heroiclabs/nakama/v2/server.(*Pipeline).matchmakerAdd\n\tgithub.com/heroiclabs/nakama/v2/server/pipeline_matchmaker.go:85\ngithub.com/heroiclabs/nakama/v2/server.(*Pipeline).ProcessRequest\n\tgithub.com/heroiclabs/nakama/v2/server/pipeline.go:154\ngithub.com/heroiclabs/nakama/v2/server.(*sessionWS).Consume\n\tgithub.com/heroiclabs/nakama/v2/server/session_ws.go:243\ngithub.com/heroiclabs/nakama/v2/server.NewSocketWsAcceptor.func2\n\tgithub.com/heroiclabs/nakama/v2/server/socket_ws.go:100\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2012\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\tgithub.com/gorilla/mux@v1.7.4/mux.go:210\ngithub.com/gorilla/handlers.(*cors).ServeHTTP\n\tgithub.com/gorilla/handlers@v1.4.2/cors.go:138\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:2807\nnet/http.(*conn).serve\n\tnet/http/server.go:1895”}

I have called function on hook
nk.register_matchmaker_matched(make_match)

@kmsudhir It’s not possible to help because your code is not in the post. It’s clear from the error message though:

make_match.lua:7: attempt to index a non-table object(nil) with key ‘presence’

You have an error in your Lua code where you attempt to access a field on a nil table.

Hope this helps.