diff --git a/src/catch2/interfaces/catch_interfaces_capture.hpp b/src/catch2/interfaces/catch_interfaces_capture.hpp index 4e27a985..ad584794 100644 --- a/src/catch2/interfaces/catch_interfaces_capture.hpp +++ b/src/catch2/interfaces/catch_interfaces_capture.hpp @@ -106,11 +106,7 @@ namespace Catch { void missingCaptureInstance(); } inline IResultCapture& getResultCapture() { - if (auto* capture = getCurrentContext().getResultCapture()) { - return *capture; - } else { - Detail::missingCaptureInstance(); - } + return *getCurrentContext().getResultCapture(); } }