This commit is contained in:
@@ -2,6 +2,7 @@ package client
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"math"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -256,8 +257,9 @@ func GetDbMessage(dbFile string, dbId int64, password string) (*meowlib.DbMessag
|
||||
}
|
||||
defer rows.Close()
|
||||
var dbm meowlib.DbMessage
|
||||
found := false
|
||||
for rows.Next() {
|
||||
|
||||
found = true
|
||||
var id int64
|
||||
var m []byte
|
||||
err = rows.Scan(&id, &m)
|
||||
@@ -272,7 +274,9 @@ func GetDbMessage(dbFile string, dbId int64, password string) (*meowlib.DbMessag
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
}
|
||||
if !found {
|
||||
return nil, fmt.Errorf("message row %d not found in %s", dbId, dbFile)
|
||||
}
|
||||
return &dbm, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user