Skip to content

Commit d806df0

Browse files
fix: Remove BoundCylinderToZPhi final, add exception (#3926)
- I missed a `final` in one location (see #3923) - Adding an exception to `GridAccessJsonConverter::toJson`. This was previously silently returning an empty json object if none of the downcasts worked. Since the downcast chain is not exhaustive, I think it's better to throw if there's an unhandled case.
1 parent 797c3c3 commit d806df0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Core/include/Acts/Utilities/GridAccessHelpers.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class LocalSubspace : public IBoundToGridLocal {
212212
}
213213
};
214214

215-
class BoundCylinderToZPhi final : public IBoundToGridLocal {
215+
class BoundCylinderToZPhi : public IBoundToGridLocal {
216216
public:
217217
double radius = 1.;
218218
double shift = 0.;

Plugins/Json/src/GridJsonConverter.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,11 @@ nlohmann::json Acts::GridAccessJsonConverter::toJson(
439439
jBoundToGridLocal["shift"] = boundCylinderToZPhi->shift;
440440
}
441441

442+
if (jBoundToGridLocal.empty()) {
443+
throw std::invalid_argument(
444+
"GridAccessJsonConverter: boundToGridLocal type not supported.");
445+
}
446+
442447
return jBoundToGridLocal;
443448
}
444449

0 commit comments

Comments
 (0)