We investigate effect of a test magnetic field on the process of destroying near-extremal Kerr black hole with a charged test particle. It has been shown that it would be possible to throw a charged test particle into the near extremal rotating black hole and make it go past the extremality i.e. turn Kerr black hole into the Kerr-Newmann naked singularity. Typically in an astrophysical scenario black holes are believed to be surrounded by a magnetic field. Magnetic field although small, affects motion of charged particles drastically due to the large Lorentz force, as the electromagnetic force is much stronger that the gravity. Thus a test magnetic field can affect the process of destroying black holes and restore the cosmic censorship in the astrophysical context. We show that a test magnetic field would act as a cosmic censor beyond a certain threshold value. We try to gauge the magnitude of the magnetic field by comparing its energy density with that of the change in the curvature induced by the test particle. We find that the magnetic field required in only as strong as or slightly stronger as compared to the value for which its effect of the background geometry is comparable to the tiny backreaction as that of the test particle. In such a case however one has to take take into account effect of the magnetic field on the background geometry, which is difficult to implement in the absence of any exact near-extremal rotating magnetized black hole solutions. We argue that magnetic field would still act as a cosmic censor.