Properly fix nil value in filterConvertTypeWildcardToSQL

This commit is contained in:
Cnly 2019-08-07 00:20:46 +08:00
parent ed521ba517
commit 843295af9d

View file

@ -22,7 +22,7 @@ import (
// https://matrix.org/docs/spec/client_server/r0.3.0.html#post-matrix-client-r0-user-userid-filter // https://matrix.org/docs/spec/client_server/r0.3.0.html#post-matrix-client-r0-user-userid-filter
// to SQL wildcards that can be used with LIKE() // to SQL wildcards that can be used with LIKE()
func filterConvertTypeWildcardToSQL(values []string) []string { func filterConvertTypeWildcardToSQL(values []string) []string {
if len(values) == 0 { if values == nil {
// Return nil instead of []string{} so IS NULL can work correctly when // Return nil instead of []string{} so IS NULL can work correctly when
// the return value is passed into SQL queries // the return value is passed into SQL queries
return nil return nil