Skip to content

Commit 1270f05

Browse files
Only plot histogram when possible (#190)
Do not try to plot a histogram with less than 2 values as it crashes
1 parent b2d7d7d commit 1270f05

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/data/hepmc32summary.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ function main()
5050
println("File $file")
5151
println(" Number of events: $n_events")
5252
println(" Average number of particles: ", mean(n_particles))
53-
println(histogram(n_particles))
53+
if n_events > 1
54+
println(histogram(n_particles))
55+
end
5456
end
5557
end
5658
end

0 commit comments

Comments
 (0)