diff --git a/ApprovalTests/integrations/catch/Catch2Approvals.h b/ApprovalTests/integrations/catch/Catch2Approvals.h index 4dac11ad..491ab4d8 100644 --- a/ApprovalTests/integrations/catch/Catch2Approvals.h +++ b/ApprovalTests/integrations/catch/Catch2Approvals.h @@ -48,7 +48,10 @@ struct Catch2ApprovalListener : Catch::TestEventListenerBase virtual void sectionEnded(Catch::SectionStats const& /*sectionStats*/) override { - currentTest.sections.pop_back(); + if (!currentTest.sections.empty()) + { + currentTest.sections.pop_back(); + } } }; //}