mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Check for empty expression properly
The old code was a left-over from the times when the `capturedExpression` member was a `const char*`, which could always be indexed. With the change to use `StringRef`, blindly indexing 0th element is invalid, as it is not indexable part of a StringRef.
This commit is contained in:
		| @@ -45,7 +45,7 @@ namespace Catch { | ||||
|     } | ||||
|  | ||||
|     bool AssertionResult::hasExpression() const { | ||||
|         return m_info.capturedExpression[0] != 0; | ||||
|         return !m_info.capturedExpression.empty(); | ||||
|     } | ||||
|  | ||||
|     bool AssertionResult::hasMessage() const { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský