diff --git a/src/THcParmList.cxx b/src/THcParmList.cxx index 240344ce5a66838db2c0015aaf1af5f6f9f52cd7..c181fbdfb14ee01bb1d2840914fe7ba6df87b7e3 100644 --- a/src/THcParmList.cxx +++ b/src/THcParmList.cxx @@ -657,7 +657,11 @@ Int_t THcParmList::ReadArray(const char* attrC, T* array, Int_t size) } Int_t sz = var->GetLen(); const void *vp = var->GetValuePointer(); - if(size != sz) { + if(size > sz) { + cout << "*** ERROR: requested " << size << " elements of " << attrC << + " which has only " << sz << " elements" << endl; + exit(EXIT_FAILURE); + } else if(size < sz) { cout << "*** WARNING: requested " << size << " elements of " << attrC << " which has length " << sz << endl; }