From 0930ecf274da80850c4cd6b260e9f94d2eba6269 Mon Sep 17 00:00:00 2001 From: Timm Ruppert Date: Thu, 7 Nov 2024 16:38:23 +0100 Subject: [PATCH] added more tests for native binary reader Signed-off-by: Timm Ruppert --- src/tracefile/reader/NativeBinaryTraceFileReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tracefile/reader/NativeBinaryTraceFileReader.cpp b/src/tracefile/reader/NativeBinaryTraceFileReader.cpp index b454af3..c2e2a19 100644 --- a/src/tracefile/reader/NativeBinaryTraceFileReader.cpp +++ b/src/tracefile/reader/NativeBinaryTraceFileReader.cpp @@ -60,7 +60,7 @@ void NativeBinaryTraceFileReader::Close() { trace_file_.close(); } bool NativeBinaryTraceFileReader::HasNext() { return (trace_file_ && trace_file_.peek() != EOF); } std::optional NativeBinaryTraceFileReader::ReadMessage() { - if (!trace_file_) { + if ((!trace_file_) || !trace_file_.is_open()) { return std::nullopt; } const auto serialized_msg = ReadNextMessageFromFile();