(a) No person shall intentionally, knowingly, or recklessly carry on or about the person while inside any building in which judicial proceedings are in progress any weapon prohibited by § 39-17-1302(a), for the purpose of going armed; provided, that if the weapon carried is a firearm, the person is in violation of this section regardless of whether the weapon is carried for the purpose of going armed.
(b) Any person violating subsection (a) commits a Class E felony.
(c) Subsection (a) shall not apply to any person who:
(1) Is in the actual discharge of official duties as a law enforcement officer, or is employed in the army, air force, navy, coast guard or marine service of the United States or any member of the Tennessee national guard in the line of duty and pursuant to military regulations, or is in the actual discharge of official duties as a guard employed by a penal institution, or as a bailiff, marshal or other court officer who has responsibility for protecting persons or property or providing security;
(2) Has been directed by a court to bring the firearm for purposes of providing evidence;
(3) Is in the actual discharge of official duties as a judge, and:
(A) Is authorized to carry a handgun pursuant to § 39-17-1351;
(B) Keeps the handgun concealed at all times when in the discharge of such duties; and
(C) Is vested with judicial powers under § 16-1-101; or
(4)
(A) Is in the actual discharge of official duties as a county commissioner and:
(i) Is authorized to carry a handgun pursuant to § 39-17-1351; and
(ii) Is in a building in which county commission meetings are held, but is not in the room in which judicial proceedings are in progress.
(B) As used in this subdivision (c)(4), “county commissioner” means a member of a local legislative body known as a board of county commissioners and does not include a member of the legislative body of a metropolitan government.