diff --git a/crates/rattler_repodata_gateway/src/gateway/query.rs b/crates/rattler_repodata_gateway/src/gateway/query.rs index 094564b07..f759069ae 100644 --- a/crates/rattler_repodata_gateway/src/gateway/query.rs +++ b/crates/rattler_repodata_gateway/src/gateway/query.rs @@ -96,6 +96,11 @@ impl RepoDataQuery { /// Execute the query and return the resulting repodata records. pub async fn execute(self) -> Result, GatewayError> { + // Short circuit if there are no specs + if self.specs.is_empty() { + return Ok(Vec::default()); + } + // Collect all the channels and platforms together let channels_and_platforms = self .channels @@ -127,6 +132,11 @@ impl RepoDataQuery { } } + // Short circuit if there are no channels or platforms specified + if direct_url_specs.is_empty() && channels_and_platforms.is_empty() { + return Ok(Vec::default()); + } + // Result offset for direct url queries. let direct_url_offset = usize::from(!direct_url_specs.is_empty());