Skip to content

Commit

Permalink
fix(psl): don't trust datasource array to contain at least 1 datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
jkomyno committed Oct 31, 2024
1 parent 8ce72a2 commit b1526d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion psl/psl-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ fn validate_configuration(
// We need to know the active provider to determine which features are active.
// This was originally introduced because the `fullTextSearch` preview feature will hit GA stage
// one connector at a time (Prisma 6 GAs it for MySQL, other connectors may follow in future releases).
let active_provider = datasources[0].active_provider;
let active_provider = datasources.get(0).map(|ds| ds.active_provider).unwrap_or_default();

Check failure on line 179 in psl/psl-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy linting

accessing first element with `datasources.get(0)`
let generators = generator_loader::load_generators_from_ast(schema_ast, diagnostics, active_provider);

Configuration::new(generators, datasources, diagnostics.warnings().to_owned())
Expand Down

0 comments on commit b1526d5

Please sign in to comment.