Fix crash when colors are disabled
This commit is contained in:
committed by
Andrzej Rybczak
parent
99107c5b39
commit
a22cd2c68c
@@ -214,6 +214,10 @@ Color Color::End(0, 0, false, true);
|
||||
|
||||
int Color::pairNumber() const
|
||||
{
|
||||
// If colors are disabled, return default pair value.
|
||||
if (color_pair_map.empty())
|
||||
return 0;
|
||||
|
||||
int result = 0;
|
||||
if (isEnd())
|
||||
throw std::logic_error("'end' doesn't have a corresponding pair number");
|
||||
|
||||
Reference in New Issue
Block a user