Skip to content

Commit

Permalink
link: Add explicit check for non-null surface
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Aug 26, 2024
1 parent d8b9b3d commit 4a95288
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Core/include/Acts/Geometry/PortalLinkBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ class PortalLinkBase {
/// called from derived classes
/// @param surface The surface
explicit PortalLinkBase(std::shared_ptr<RegularSurface> surface)
: m_surface(std::move(surface)) {}
: m_surface(std::move(surface)) {
if (!m_surface) {
throw std::invalid_argument("Surface pointer must not be null");
}
}

public:
/// Virtual destructor in case the object is held as a derived
Expand Down

0 comments on commit 4a95288

Please sign in to comment.