Attempt to prevent analyser warnings about dereferencing null.

This commit is contained in:
Phil Nash 2014-05-20 18:41:34 +01:00
parent a2d8f774d2
commit 59d556907d

View File

@ -23,10 +23,16 @@ namespace Catch {
public: // IContext public: // IContext
virtual IResultCapture& getResultCapture() { virtual IResultCapture& getResultCapture() {
return *m_resultCapture; if( m_resultCapture )
return *m_resultCapture;
else
throw std::logic_error( "No result capture instance" );
} }
virtual IRunner& getRunner() { virtual IRunner& getRunner() {
return *m_runner; if( m_runner )
return *m_runner;
else
throw std::logic_error( "No runner instance" );
} }
virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) { virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) {
return getGeneratorsForCurrentTest() return getGeneratorsForCurrentTest()