diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 42cd36ad59..5c7a0508b9 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -240,6 +240,12 @@ By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/p ## 🐛 Fixes +### Fix panic when dev mode enabled with empty config file ([Issue #2182](https://github.com/apollographql/router/issues/2182)) + +If you're running the Router with dev mode with an empty config file, it will no longer panic + +By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/2165 + ### fix build_docker_image.sh script when using default repo ([PR #2163](https://github.com/apollographql/router/pull/2163)) Adding the `-r` flag recently broke the existing functionality to build from the default repo using `-b`. This fixes that. diff --git a/apollo-router/src/configuration/mod.rs b/apollo-router/src/configuration/mod.rs index 30ed5dab67..721004b4ee 100644 --- a/apollo-router/src/configuration/mod.rs +++ b/apollo-router/src/configuration/mod.rs @@ -217,8 +217,8 @@ impl Configuration { // Enable experimental_response_trace_id self.apollo_plugins .plugins - .get_mut("telemetry") - .expect("telemetry plugin must be initialized at this point") + .entry("telemetry") + .or_insert_with(|| json!({})) .as_object_mut() .expect("configuration for telemetry must be an object") .entry("tracing")