When election campaigns turn violent, journalists are likely to be in the thick of it. Unfortunately, danger is often part of the job for reporters, but it is the responsibility of governments and those organizing elections to ensure that that danger is kept to a minimum.
Any physical attack or interference with a journalist is likely to be a crime under the ordinary law of the country. However, in view of the particular importance of the media in elections, some countries create specific offences related to attacks on journalists during elections. For example, Section 8 of the South African Electoral Act penalizes offences against media workers with fines of up to R200,000, imprisonment and disqualification from further participation in the election.
The corollary to this is that laws restricting media freedom and the safe conduct of journalism should be repealed in advance of the election. Part of the safety of journalists is not being at risk of arrest for normal professional activities. This would include, for example, police or judicial powers to compel a journalist to divulge confidential sources of information.
However, just as important as what the law says is the message that is clearly communicated to all those taking part in the elections. Journalists' organizations, such as the International Federation of Journalists, usually recommend that governments (and electoral authorities) give a clear public statement at the start of the election campaign, informing all parties and the law enforcement agencies that the media are an essential part of the democratic process - and that anyone preventing them from going about their business will be dealt with using the full force of the law. Of course, the danger to journalists does not come only from over-enthusiastic party activists - often they are at risk from law enforcement officials trained in the ways of dictatorship. Hence the importance of clear public instructions - with the essential follow-up that any attacks are fully investigated and the perpetrators brought to justice.
Codes of conduct for political parties are a device sometimes used in situations where violence is likely. These too should include a clear statement on the importance of the media to the election process and the need to refrain from attacks on them.
Physical protection of journalists may be more difficult, since an intrusive police presence may interfere with the media's freedom to gather information. However, law enforcement officials should also be under instructions about the responsibility to protect journalists against attack, physically if necessary.
The International Federation of Journalists has good practical advice on this issue. See International Federation of Journalists: Election Reporting Handbook.