mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
🐛 Fix NPE
This commit is contained in:
@@ -1316,6 +1316,9 @@ func queryRow(query string, args ...interface{}) *sql.Row {
|
||||
logging.LogErrorf("statement is empty")
|
||||
return nil
|
||||
}
|
||||
if nil == db {
|
||||
return nil
|
||||
}
|
||||
return db.QueryRow(query, args...)
|
||||
}
|
||||
|
||||
@@ -1324,6 +1327,9 @@ func query(query string, args ...interface{}) (*sql.Rows, error) {
|
||||
if "" == query {
|
||||
return nil, errors.New("statement is empty")
|
||||
}
|
||||
if nil == db {
|
||||
return nil, errors.New("database is nil")
|
||||
}
|
||||
return db.Query(query, args...)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user