-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 0.0.2
-
Component/s: Error Handling
-
None
-
Environment:Linux
Received the following panic when doing some negative testing. This seems to have occurred when Close() was called on a cursor after Next() returned false.
I started a long running query with MongoDB running and brought mongod down in the middle of it returning results. So mongod was down at the time of the Close call.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0x743edc]
goroutine 59 [running]:
github.com/mongodb/mongo-go-driver/x/mongo/driver/topology.(*cursor).legacy(...)
/home/vagrant/go/pkg/mod/github.com/mongodb/mongo-go-driver@v0.2.0/x/mongo/driver/topology/cursor.go:142
github.com/mongodb/mongo-go-driver/x/mongo/driver/topology.(*cursor).Close(0xc00007ab40, 0x9ab240, 0xc0000140b0, 0x0, 0x0)
/home/vagrant/go/pkg/mod/github.com/mongodb/mongo-go-driver@v0.2.0/x/mongo/driver/topology/cursor.go:207 +0x16c