The judge said the man did not pose a danger to the public.