mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-25 16:02:17 +03:00
fix: handle nil pointer dereference
This commit is contained in:
parent
876354e58e
commit
65a792be3a
@ -99,8 +99,11 @@ func (r sqlRepository) executeSQL(sq Sqlizer) (int64, error) {
|
||||
return 0, err
|
||||
}
|
||||
start := time.Now()
|
||||
var c int64
|
||||
res, err := r.ormer.Raw(query, args...).Exec()
|
||||
c, _ := res.RowsAffected()
|
||||
if res != nil {
|
||||
c, _ = res.RowsAffected()
|
||||
}
|
||||
r.logSQL(query, args, err, c, start)
|
||||
if err != nil {
|
||||
if err.Error() != "LastInsertId is not supported by this driver" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user