diff --git a/api/authz.go b/api/authz.go
index <HASH>..<HASH> 100644
--- a/api/authz.go
+++ b/api/authz.go
@@ -82,6 +82,9 @@ func buildAuthz(ctx context.Context, reqs ...buildReq) error {
 			}
 		}
 	}
+	if len(accountIDs) == 0 {
+		return nil
+	}
 	projects, err := appdb.ProjectsByAccount(ctx, accountIDs...)
 	if err != nil {
 		return err
api: fix authz for build with no account ids

Closes chain/chainprv#<I>.
Reviewers: @jeffomatic