Ignore:
Timestamp:
Apr 21, 2013, 3:04:41 AM (10 years ago)
Author:
Peter
Message:

refs #746. Add docs and throw in aux_del if tag is absent (rather than undefined behaviour)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/BamRead.cc

    r3028 r3029  
    2626
    2727#include YAT_BAM_HEADER
     28
     29#include "yat/utility/Exception.h"
    2830
    2931#include <algorithm>
     
    9193  {
    9294    assert(bam_);
    93     bam_aux_del(bam_, bam_aux_get(bam_, tag));
     95    uint8_t* s = bam_aux_get(bam_, tag);
     96    if (s)
     97      bam_aux_del(bam_, s);
     98    std::stringstream msg("BamRead::aux_del: absent tag: ");
     99    msg << "'" << tag << "'";
     100    throw utility::runtime_error(msg.str());
    94101  }
    95102
Note: See TracChangeset for help on using the changeset viewer.