mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 15:26:11 +01:00
Added null-ptr check in Colour::use()
This commit is contained in:
parent
f41051f22a
commit
bbbd5c4e08
@ -222,8 +222,14 @@ namespace Catch {
|
|||||||
|
|
||||||
void Colour::use( Code _colourCode ) {
|
void Colour::use( Code _colourCode ) {
|
||||||
static IColourImpl* impl = platformColourInstance();
|
static IColourImpl* impl = platformColourInstance();
|
||||||
|
// Strictly speaking, this cannot possibly happen.
|
||||||
|
// However, under some conditions it does happen (see #1626),
|
||||||
|
// and this change is small enough that we can let practicality
|
||||||
|
// triumph over purity in this case.
|
||||||
|
if (impl != NULL) {
|
||||||
impl->use( _colourCode );
|
impl->use( _colourCode );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::ostream& operator << ( std::ostream& os, Colour const& ) {
|
std::ostream& operator << ( std::ostream& os, Colour const& ) {
|
||||||
return os;
|
return os;
|
||||||
|
Loading…
Reference in New Issue
Block a user