Skip to content

Commit

Permalink
Use a nil pointer is entry is ""
Browse files Browse the repository at this point in the history
  • Loading branch information
otoolep committed Aug 8, 2024
1 parent 7205526 commit ffc0202
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sqlite3_load_extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ func (c *SQLiteConn) LoadExtension(lib string, entry string) error {
return errors.New(C.GoString(C.sqlite3_errmsg(c.db)))
}

if err := c.loadExtension(lib, &entry); err != nil {
var ptr *string
if entry != "" {
ptr = &entry
}
if err := c.loadExtension(lib, ptr); err != nil {
C.sqlite3_enable_load_extension(c.db, 0)
return err
}
Expand Down

0 comments on commit ffc0202

Please sign in to comment.