coverity #24442, add check on nullness of primary particles pointer