@@ -612,9 +612,11 @@ func (q *fakeQuerier) GetAuthorizedUserCount(ctx context.Context, params databas
612
612
defer q .mutex .RUnlock ()
613
613
614
614
// Call this to match the same function calls as the SQL implementation.
615
- _ ,err := prepared .CompileToSQL (ctx ,rbac .ConfigWithoutACL ())
616
- if err != nil {
617
- return - 1 ,err
615
+ if prepared != nil {
616
+ _ ,err := prepared .CompileToSQL (ctx ,rbac .ConfigWithoutACL ())
617
+ if err != nil {
618
+ return - 1 ,err
619
+ }
618
620
}
619
621
620
622
users := make ([]database.User ,0 ,len (q .users ))
@@ -895,10 +897,12 @@ func (q *fakeQuerier) GetAuthorizedWorkspaces(ctx context.Context, arg database.
895
897
q .mutex .RLock ()
896
898
defer q .mutex .RUnlock ()
897
899
898
- // Call this to match the same function calls as the SQL implementation.
899
- _ ,err := prepared .CompileToSQL (ctx ,rbac .ConfigWithoutACL ())
900
- if err != nil {
901
- return nil ,err
900
+ if prepared != nil {
901
+ // Call this to match the same function calls as the SQL implementation.
902
+ _ ,err := prepared .CompileToSQL (ctx ,rbac .ConfigWithoutACL ())
903
+ if err != nil {
904
+ return nil ,err
905
+ }
902
906
}
903
907
904
908
workspaces := make ([]database.Workspace ,0 )
@@ -1708,9 +1712,11 @@ func (q *fakeQuerier) GetAuthorizedTemplates(ctx context.Context, arg database.G
1708
1712
defer q .mutex .RUnlock ()
1709
1713
1710
1714
// Call this to match the same function calls as the SQL implementation.
1711
- _ ,err := prepared .CompileToSQL (ctx ,rbac .ConfigWithoutACL ())
1712
- if err != nil {
1713
- return nil ,err
1715
+ if prepared != nil {
1716
+ _ ,err := prepared .CompileToSQL (ctx ,rbac .ConfigWithACL ())
1717
+ if err != nil {
1718
+ return nil ,err
1719
+ }
1714
1720
}
1715
1721
1716
1722
var templates []database.Template