Skip to content

Commit def9030

Browse files
committed
fix: checking if hp_list is populated
1 parent 531f490 commit def9030

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/framework/HardProcess.cc

+6-3
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,12 @@ void HardProcess::CollectHeader(weak_ptr<JetScapeWriter> w) {
123123
header.SetSigmaErr(GetSigmaErr());
124124
header.SetPtHat(GetPtHat());
125125
header.SetEventWeight(GetEventWeight());
126-
header.SetVertexX(hp_list[0]->x_in().x());
127-
header.SetVertexY(hp_list[0]->x_in().y());
128-
header.SetVertexZ(hp_list[0]->x_in().z());
126+
127+
if (hp_list.size() > 0) {
128+
header.SetVertexX(hp_list[0]->x_in().x());
129+
header.SetVertexY(hp_list[0]->x_in().y());
130+
header.SetVertexZ(hp_list[0]->x_in().z());
131+
}
129132
}
130133
}
131134

0 commit comments

Comments
 (0)