diff --git a/dumux/porousmediumflow/richards/localresidual.hh b/dumux/porousmediumflow/richards/localresidual.hh
index 42d231f2faf8eb4cec367b5553ea1c1a733aa3d7..6bf14078b96fa45a51c0c5529b2840f31d86d062 100644
--- a/dumux/porousmediumflow/richards/localresidual.hh
+++ b/dumux/porousmediumflow/richards/localresidual.hh
@@ -34,6 +34,18 @@
 #include <dumux/discretization/extrusion.hh>
 #include <dumux/flux/referencesystemformulation.hh>
 
+namespace Dumux::Detail {
+// helper structs and functions detecting if the user-defined problem class
+// implements addRobinFluxDerivatives
+template <typename T, typename ...Ts>
+using RobinDerivDetector = decltype(std::declval<T>().addRobinFluxDerivatives(std::declval<Ts>()...));
+
+template<class T, typename ...Args>
+static constexpr bool hasAddRobinFluxDerivatives()
+{ return Dune::Std::is_detected<RobinDerivDetector, T, Args...>::value; }
+
+} // end namespace Dumux::Detail
+
 namespace Dumux {
 
 /*!
@@ -486,9 +498,11 @@ public:
                                  const ElementFluxVariablesCache& elemFluxVarsCache,
                                  const SubControlVolumeFace& scvf) const
     {
-        /* forward to problem for the user to implement the Robin derivatives*/
-        problem.addRobinFluxDerivatives(derivativeMatrices, element, fvGeometry, curElemVolVars, elemFluxVarsCache, scvf);
-
+        if constexpr(Detail::hasAddRobinFluxDerivatives<Problem,
+            PartialDerivativeMatrices, Element, FVElementGeometry,
+            ElementVolumeVariables, ElementFluxVariablesCache, SubControlVolumeFace>()
+        )
+            problem.addRobinFluxDerivatives(derivativeMatrices, element, fvGeometry, curElemVolVars, elemFluxVarsCache, scvf);
     }
 
 private:
diff --git a/test/porousmediumflow/richards/lens/problem.hh b/test/porousmediumflow/richards/lens/problem.hh
index 40599e10ffa1a505a088d9da00ed174bfea1011a..b7f8e093597909b910043bfd39b438b338e592d8 100644
--- a/test/porousmediumflow/richards/lens/problem.hh
+++ b/test/porousmediumflow/richards/lens/problem.hh
@@ -73,8 +73,6 @@ class RichardsLensProblem : public PorousMediumFlowProblem<TypeTag>
     using Scalar = GetPropType<TypeTag, Properties::Scalar>;
     using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices;
     using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
-    using FVElementGeometry = typename GridGeometry::LocalView;
-    using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace;
     enum {
         // copy some indices for convenience
         pressureIdx = Indices::pressureIdx,
@@ -194,25 +192,6 @@ public:
 
     // \}
 
-    /*!
-     * \brief Adds Robin flux derivatives for wetting phase. This is needed in case of solution dependent Neumann conditions.
-     *
-     * \param derivativeMatrices The matrices containing the derivatives
-     * \param element The element
-     * \param fvGeometry The finite volume element geometry
-     * \param curElemVolVars The current element volume variables
-     * \param elemFluxVarsCache The element flux variables cache
-     * \param scvf The sub control volume face
-     */
-    template<class PartialDerivativeMatrices, class ElementVolumeVariables, class ElementFluxVariablesCache>
-    void addRobinFluxDerivatives(PartialDerivativeMatrices& derivativeMatrices,
-                                 const Element& element,
-                                 const FVElementGeometry& fvGeometry,
-                                 const ElementVolumeVariables& elemVolVars,
-                                 const ElementFluxVariablesCache& elemFluxVarsCache,
-                                 const SubControlVolumeFace& scvf) const
-    {}
-
 private:
     PrimaryVariables initial_(const GlobalPosition &globalPos) const
     {