| Index: impl/memory/raw_datastore_data.go
|
| diff --git a/impl/memory/raw_datastore_data.go b/impl/memory/raw_datastore_data.go
|
| index a37a2abf63392795438f4207e43e487fb0fa8025..dff438b30b33a9d6415fa218e698f26b1fdd3f55 100644
|
| --- a/impl/memory/raw_datastore_data.go
|
| +++ b/impl/memory/raw_datastore_data.go
|
| @@ -63,16 +63,18 @@ func rootIDsKey(kind string) []byte {
|
| }
|
|
|
| func curVersion(ents *memCollection, key []byte) int64 {
|
| - if v := ents.Get(key); v != nil {
|
| - pm, err := rpm(v)
|
| - if err != nil {
|
| - panic(err) // memory corruption
|
| - }
|
| - pl, ok := pm["__version__"]
|
| - if ok && len(pl) > 0 && pl[0].Type() == ds.PTInt {
|
| - return pl[0].Value().(int64)
|
| + if ents != nil {
|
| + if v := ents.Get(key); v != nil {
|
| + pm, err := rpm(v)
|
| + if err != nil {
|
| + panic(err) // memory corruption
|
| + }
|
| + pl, ok := pm["__version__"]
|
| + if ok && len(pl) > 0 && pl[0].Type() == ds.PTInt {
|
| + return pl[0].Value().(int64)
|
| + }
|
| + panic(fmt.Errorf("__version__ property missing or wrong: %v", pm))
|
| }
|
| - panic(fmt.Errorf("__version__ property missing or wrong: %v", pm))
|
| }
|
| return 0
|
| }
|
|
|