From b6b60a6694a3682a08c20a43e52de3273bd5877a Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Wed, 6 Nov 2024 15:57:37 +0100 Subject: [PATCH] [FIX] sam_file_output move --- include/seqan3/io/sam_file/output.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/seqan3/io/sam_file/output.hpp b/include/seqan3/io/sam_file/output.hpp index c59ab897e0..e6233ceef6 100644 --- a/include/seqan3/io/sam_file/output.hpp +++ b/include/seqan3/io/sam_file/output.hpp @@ -155,7 +155,8 @@ class sam_file_output //!\brief The destructor will write the header if it has not been written before. ~sam_file_output() { - if (header_has_been_written) + // !primary_stream indicates moved-from object + if (header_has_been_written || !primary_stream) return; assert(!format.valueless_by_exception());