Skip to content

Commit

Permalink
[FIX] sam_file_output move
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Nov 6, 2024
1 parent 4d03890 commit a96c7f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/seqan3/io/sam_file/output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ 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
// unique_ptr holds a nullptr after being moved from
// See https://eel.is/c++draft/unique.ptr#single.ctor-18
if (header_has_been_written || !primary_stream)
return;

assert(!format.valueless_by_exception());
Expand Down

0 comments on commit a96c7f2

Please sign in to comment.