Closed navono closed 5 years ago
Could you share a code example so I can reproduce it?
storm : v2.1.2 golang: v1.13.1
package main
import (
"fmt"
"github.com/asdine/storm"
)
func main() {
db , err := storm.Open("./db")
if err != nil {
return
}
repo := db.From("repo")
// If store some data in `repo` bucket, it will not panic
nodes := repo.PrefixScan("prj")
fmt.Print(nodes)
}
If db is empty, it will panic, but if db alreay holds some data it's totaly OK.
I don't this usage is rightful or not, in some cases I use this to check lists from specified node.
Thank you, it should be good now. It will be shipped as part of the next release
The root cause is in
sacn.go
, not check the returned value:If bucket not exists,
GetBucket
will returnnil
.