Skip to content

Commit 8d1c982

Browse files
Harshil Goeldarkcoderrises
authored andcommitted
fix(core): Fix bug in export with empty data (#9502)
1 parent 4128279 commit 8d1c982

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

worker/export.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ func (e *exporter) toRDF() (*bpb.KVList, error) {
228228

229229
prefix := fmt.Sprintf(uidFmtStrRdf+" <%s> ", e.uid, e.attr)
230230
err := e.pl.Iterate(e.readTs, 0, func(p *pb.Posting) error {
231-
fmt.Fprint(bp, prefix)
232231
if p.PostingType == pb.Posting_REF {
232+
fmt.Fprint(bp, prefix)
233233
fmt.Fprintf(bp, uidFmtStrRdf, p.Uid)
234234
} else {
235235
val := types.Val{Tid: types.TypeID(p.ValType), Value: p.Value}
@@ -238,6 +238,7 @@ func (e *exporter) toRDF() (*bpb.KVList, error) {
238238
glog.Errorf("Ignoring error: %+v\n", err)
239239
return nil
240240
}
241+
fmt.Fprint(bp, prefix)
241242
fmt.Fprintf(bp, "%s", escapedString(str))
242243

243244
tid := types.TypeID(p.ValType)

0 commit comments

Comments
 (0)