The judge criticised the rapper's “dangerous and irresponsible” actions