From 37588c0ae5405906c4f53f2352b385e629360fb2 Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Mon, 13 Jul 2020 13:44:36 -0700 Subject: [PATCH] fix(dgraph): Fix segmentation fault in draft.go (#5798) (#5860) Use the GetXXX methods of the generated protobufs to correctly handle the case where no predicate hints are available. Fixes DGRAPH-1753. --- worker/draft.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/draft.go b/worker/draft.go index d78be8d961d..77d62da41e5 100644 --- a/worker/draft.go +++ b/worker/draft.go @@ -394,7 +394,7 @@ func (n *node) applyMutations(ctx context.Context, proposal *pb.Proposal) (rerr for attr, storageType := range schemaMap { if _, err := schema.State().TypeOf(attr); err != nil { hint := pb.Metadata_DEFAULT - if mutHint, ok := proposal.Mutations.Metadata.PredHints[attr]; ok { + if mutHint, ok := proposal.GetMutations().GetMetadata().GetPredHints()[attr]; ok { hint = mutHint } if err := createSchema(attr, storageType, hint); err != nil {