Skip to content

Commit 538b499

Browse files
author
Harshil Goel
authored
fix(core): Fix bug in export with empty data (#9502)
1 parent 1ac8012 commit 538b499

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
@@ -218,8 +218,8 @@ func (e *exporter) toRDF() (*bpb.KVList, error) {
218218

219219
prefix := fmt.Sprintf(uidFmtStrRdf+" <%s> ", e.uid, e.attr)
220220
err := e.pl.Iterate(e.readTs, 0, func(p *pb.Posting) error {
221-
fmt.Fprint(bp, prefix)
222221
if p.PostingType == pb.Posting_REF {
222+
fmt.Fprint(bp, prefix)
223223
fmt.Fprintf(bp, uidFmtStrRdf, p.Uid)
224224
} else {
225225
val := types.Val{Tid: types.TypeID(p.ValType), Value: p.Value}
@@ -228,6 +228,7 @@ func (e *exporter) toRDF() (*bpb.KVList, error) {
228228
glog.Errorf("Ignoring error: %+v\n", err)
229229
return nil
230230
}
231+
fmt.Fprint(bp, prefix)
231232
fmt.Fprintf(bp, "%s", escapedString(str))
232233

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

0 commit comments

Comments
 (0)