mirror of
https://github.com/matrix-org/dendrite
synced 2024-12-14 23:32:45 +00:00
Fix create filter API (#342)
This commit is contained in:
parent
bb8dcb09a1
commit
19a716e7da
1 changed files with 2 additions and 2 deletions
|
@ -92,11 +92,11 @@ func (s *filterStatements) insertFilter(
|
||||||
// Check if filter already exists in the database
|
// Check if filter already exists in the database
|
||||||
err = s.selectFilterIDByContentStmt.QueryRowContext(ctx,
|
err = s.selectFilterIDByContentStmt.QueryRowContext(ctx,
|
||||||
localpart, filterJSON).Scan(&existingFilterID)
|
localpart, filterJSON).Scan(&existingFilterID)
|
||||||
if err != nil {
|
if err != nil && err != sql.ErrNoRows {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
// If it does, return the existing ID
|
// If it does, return the existing ID
|
||||||
if len(existingFilterID) != 0 {
|
if existingFilterID != "" {
|
||||||
return existingFilterID, err
|
return existingFilterID, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue