mirror of
https://github.com/catchorg/Catch2.git
synced 2025-02-17 03:43:29 +01:00
Do not blindly access empty StringRefs
This commit is contained in:
parent
7b865daccc
commit
e2b3443fe7
@ -61,7 +61,7 @@ namespace Catch {
|
|||||||
|
|
||||||
std::string AssertionResult::getExpressionInMacro() const {
|
std::string AssertionResult::getExpressionInMacro() const {
|
||||||
std::string expr;
|
std::string expr;
|
||||||
if( m_info.macroName[0] == 0 )
|
if( m_info.macroName.empty() )
|
||||||
expr = static_cast<std::string>(m_info.capturedExpression);
|
expr = static_cast<std::string>(m_info.capturedExpression);
|
||||||
else {
|
else {
|
||||||
expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 );
|
expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 );
|
||||||
|
Loading…
Reference in New Issue
Block a user