Reject nil module and nil BestIndex result

This commit is contained in:
Yasuhiro Matsumoto
2026-07-29 09:04:45 +09:00
parent 0cfec60306
commit cad8b71943

View File

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