Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 5ff3c63

Browse files
committed
fix 2006
1 parent 90350e3 commit 5ff3c63

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

net/service/handlers.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,11 +1309,13 @@ func (service *OpenBazaarService) handleDisputeOpen(p peer.ID, pmes *pb.Message,
13091309
log.Errorf("failed calc orderID")
13101310
}
13111311

1312-
err = service.node.Datastore.Messages().Put(
1313-
fmt.Sprintf("%s-%d", orderID, int(pb.Message_DISPUTE_OPEN)),
1314-
orderID, pb.Message_DISPUTE_OPEN, p.Pretty(), repo.Message{Msg: *pmes}, "", time.Now().UnixNano(), []byte(p))
1315-
if err != nil {
1316-
log.Errorf("failed putting message (%s-%d): %v", orderID, int(pb.Message_DISPUTE_OPEN), err)
1312+
if orderID != "" {
1313+
err = service.node.Datastore.Messages().Put(
1314+
fmt.Sprintf("%s-%d", orderID, int(pb.Message_DISPUTE_OPEN)),
1315+
orderID, pb.Message_DISPUTE_OPEN, p.Pretty(), repo.Message{Msg: *pmes}, "", time.Now().UnixNano(), []byte(p))
1316+
if err != nil {
1317+
log.Errorf("failed putting message (%s-%d): %v", orderID, int(pb.Message_DISPUTE_OPEN), err)
1318+
}
13171319
}
13181320

13191321
// Verify signature

0 commit comments

Comments
 (0)