Reject nil module and nil BestIndex result
This commit is contained in:
@@ -451,6 +451,9 @@ func goVBestIndex(pVTab unsafe.Pointer, icp unsafe.Pointer) *C.char {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return mPrintf("%s", err.Error())
|
return mPrintf("%s", err.Error())
|
||||||
}
|
}
|
||||||
|
if res == nil {
|
||||||
|
return mPrintf("%s", "BestIndex returned a nil IndexResult")
|
||||||
|
}
|
||||||
if len(res.Used) != len(csts) {
|
if len(res.Used) != len(csts) {
|
||||||
return mPrintf("Result.Used != expected value", "")
|
return mPrintf("Result.Used != expected value", "")
|
||||||
}
|
}
|
||||||
@@ -708,5 +711,5 @@ func (c *SQLiteConn) CreateModule(moduleName string, module Module) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return nil
|
return fmt.Errorf("sqlite3: CreateModule requires a non-nil module")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user