diff --git a/io/io/src/TStreamerInfo.cxx b/io/io/src/TStreamerInfo.cxx index f4ef2d9e2401e..08487cb5b6287 100644 --- a/io/io/src/TStreamerInfo.cxx +++ b/io/io/src/TStreamerInfo.cxx @@ -3528,7 +3528,8 @@ static void R__WriteDestructorBody(FILE *file, TIter &next) std::vector inside; int nestedLoc; TClassEdit::GetSplit(enamebasic, inside, nestedLoc, TClassEdit::kLong64); - if (inside[1][inside[1].size()-1]=='*' || inside[2][inside[2].size()-1]=='*') { + if ((!inside[1].empty() && inside[1][inside[1].size()-1]=='*') + || (!inside[2].empty() && inside[2][inside[2].size()-1]=='*')) { fprintf(file," std::for_each( (%s %s).rbegin(), (%s %s).rend(), DeleteObjectFunctor() );\n",prefix,ename,prefix,ename); } }