Skip to content

Commit ffccb76

Browse files
committed
Fix node status unmarshalling
1 parent 4be5387 commit ffccb76

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,13 @@ func main() {
406406
if nodeStatusMsg.BlockAssemblyDetails != nil {
407407
if jsonBytes, err := json.Marshal(nodeStatusMsg.BlockAssemblyDetails); err == nil {
408408
blockAssemblyJSON = string(jsonBytes)
409+
} else {
410+
// If marshaling fails, use empty JSON object
411+
blockAssemblyJSON = "{}"
409412
}
413+
} else {
414+
// Use empty JSON object instead of empty string for NULL values
415+
blockAssemblyJSON = "{}"
410416
}
411417

412418
if err := batchService.AddNodeStatus(model.NodeStatusPG{

0 commit comments

Comments
 (0)