From ecb7f8ce3332cd21489876196e7da0331671a620 Mon Sep 17 00:00:00 2001 From: Andrea Date: Fri, 28 Oct 2022 22:30:44 +0200 Subject: [PATCH] Deal with cases in which file is a nullptr --- DQMServices/FwkIO/plugins/DQMRootSource.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DQMServices/FwkIO/plugins/DQMRootSource.cc b/DQMServices/FwkIO/plugins/DQMRootSource.cc index 9898b81e44868..dbb80255d1e88 100644 --- a/DQMServices/FwkIO/plugins/DQMRootSource.cc +++ b/DQMServices/FwkIO/plugins/DQMRootSource.cc @@ -485,7 +485,7 @@ std::shared_ptr DQMRootSource::readFile_() { m_openFiles.reserve(numFiles); for (auto& fileitem : m_catalog.fileCatalogItems()) { - TFile* file; + TFile* file = nullptr; std::string pfn; std::string lfn; std::list exInfo; @@ -550,7 +550,7 @@ std::shared_ptr DQMRootSource::readFile_() { } } //end loop over names of the file - if (!isGoodFile && m_skipBadFiles) + if (!file || (!isGoodFile && m_skipBadFiles)) continue; std::unique_ptr guid{file->Get(kCmsGuid)};