diff --git a/libs/ardour/audiofile_tagger.cc b/libs/ardour/audiofile_tagger.cc index 61a05d49ce..e2d81176e1 100644 --- a/libs/ardour/audiofile_tagger.cc +++ b/libs/ardour/audiofile_tagger.cc @@ -43,6 +43,16 @@ bool AudiofileTagger::tag_file (std::string const & filename, SessionMetadata const & metadata) { TagLib::FileRef file (filename.c_str()); + if (file.isNull()) { + std::cerr << "TagLib::FileRef is null for file" << filename << std::endl; + return true; // continue anyway?! + } + + if (!file.tag()) { + std::cerr << "TagLib::Tag is null for file" << filename << std::endl; + return true; // continue anyway?! + } + TagLib::Tag & tag (*file.tag()); tag_generic (tag, metadata);