浏览代码

Merge pull request #366 from mrjana/cnm

BitSequence should unmarshal data during get
Madhu Venugopal 10 年之前
父节点
当前提交
4a8b4af8af
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      libnetwork/bitseq/store.go

+ 6 - 1
libnetwork/bitseq/store.go

@@ -40,7 +40,12 @@ func (h *Handle) Value() []byte {
 
 // SetValue unmarshals the data from the KV store
 func (h *Handle) SetValue(value []byte) error {
-	return h.FromByteArray(value)
+	var b []byte
+	if err := json.Unmarshal(value, &b); err != nil {
+		return err
+	}
+
+	return h.FromByteArray(b)
 }
 
 // Index returns the latest DB Index as seen by this object