message: Add protections in case of unaccessible files, to try to fix running problem on grid
diff: @@ -2093,5 +2093,22 @@ void AliAnalysisTaskEmcalEmbeddingHelper::Print(Option_t* opt) const
  */
  TString AliAnalysisTaskEmcalEmbeddingHelper::GetExternalFilePath() const
  {
  + // Sanity checks and protection in case there was a problem accessing the external file
  + //
  + if ( !fChain ) {
  + AliError("No file chain found!");
  + return "";
  + }
  +
  + if ( !fChain->GetTree() ) {
  + AliError("No file tree found!");
  + return "";
  + }
  +
  + if ( !fChain->GetTree()->GetCurrentFile() ) {
  + AliError("No file found!");
  + return "";
  + }
  +
  return fChain->GetTree()->GetCurrentFile()->GetName();
  }
  