diff --git a/edgraph/server.go b/edgraph/server.go index 2d69077dbb5..7fb3803d432 100644 --- a/edgraph/server.go +++ b/edgraph/server.go @@ -350,6 +350,9 @@ func (s *Server) doMutate(ctx context.Context, qc *queryContext, resp *api.Respo if x.WorkerConfig.LudicrousMode { // Mutations are automatically committed in case of ludicrous mode, so we don't // need to manually commit. + if resp.Txn == nil { + return errors.Wrapf(err, "Txn Context is nil") + } resp.Txn.Keys = resp.Txn.Keys[:0] resp.Txn.CommitTs = qc.req.StartTs return err