Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix nullptr dereferencing warning
Browse files Browse the repository at this point in the history
niermann999 committed Jan 12, 2025
1 parent 5e89f23 commit b14262c
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/include/detray/builders/surface_factory_interface.hpp
Original file line number Diff line number Diff line change
@@ -166,7 +166,7 @@ class factory_decorator : public surface_factory_interface<detector_t> {
/// @returns access to the underlying factory - const
DETRAY_HOST
const surface_factory_interface<detector_t> *get_factory() const {
return m_factory.get();
return (m_factory == nullptr) ? m_factory.get() : nullptr;
}

/// Overwrite interface functions using callbacks to the base factory
6 changes: 3 additions & 3 deletions io/include/detray/io/backend/detail/type_info.hpp
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ get_id() {
}

/// Infer the IO material id from the material type - homogeneous material
template <concepts::homogeneous_material material_t>
template <detray::concepts::homogeneous_material material_t>
constexpr io::material_id get_id() {
using scalar_t = typename material_t::scalar_type;

@@ -67,7 +67,7 @@ constexpr io::material_id get_id() {
}

/// Infer the IO material id from the material type - material maps
template <concepts::material_map material_t>
template <detray::concepts::material_map material_t>
constexpr io::material_id get_id() {

using map_frame_t = typename material_t::local_frame_type;
@@ -88,7 +88,7 @@ constexpr io::material_id get_id() {
}

/// Infer the grid id from its coordinate system
template <concepts::surface_grid grid_t>
template <detray::concepts::surface_grid grid_t>
constexpr io::accel_id get_id() {

using frame_t = typename grid_t::local_frame_type;

0 comments on commit b14262c

Please sign in to comment.