From 843295af9d34ce64997dc3edc69776e0412fbd52 Mon Sep 17 00:00:00 2001 From: Cnly Date: Wed, 7 Aug 2019 00:20:46 +0800 Subject: [PATCH] Properly fix nil value in filterConvertTypeWildcardToSQL --- syncapi/storage/filtering.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncapi/storage/filtering.go b/syncapi/storage/filtering.go index 13fce774d..27b0b888a 100644 --- a/syncapi/storage/filtering.go +++ b/syncapi/storage/filtering.go @@ -22,7 +22,7 @@ import ( // 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() func filterConvertTypeWildcardToSQL(values []string) []string { - if len(values) == 0 { + if values == nil { // Return nil instead of []string{} so IS NULL can work correctly when // the return value is passed into SQL queries return nil