mirror of https://github.com/catchorg/Catch2.git
Attempt to prevent analyser warnings about dereferencing null.
This commit is contained in:
parent
a2d8f774d2
commit
59d556907d
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue