fix SEGFAULT during construction of Session

coloured output tried to write startup exceptions
to stream which was not initialized
This commit is contained in:
Jozef Grajciar 2019-05-15 20:14:25 +02:00
parent f1e14a1168
commit e680c4b9fb

View File

@ -134,6 +134,9 @@ namespace Catch {
#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
const auto& exceptions = getRegistryHub().getStartupExceptionRegistry().getExceptions(); const auto& exceptions = getRegistryHub().getStartupExceptionRegistry().getExceptions();
if ( !exceptions.empty() ) { if ( !exceptions.empty() ) {
config();
getCurrentMutableContext().setConfig(m_config);
m_startupExceptions = true; m_startupExceptions = true;
Colour colourGuard( Colour::Red ); Colour colourGuard( Colour::Red );
Catch::cerr() << "Errors occurred during startup!" << '\n'; Catch::cerr() << "Errors occurred during startup!" << '\n';