MADISON, Wis. (AP) — A Milwaukee judge relied on inaccurate information about a convict’s criminal history when he sentenced him to 13 years in prison, but the mistake was harmless because of the man’s multiple brushes with the law, the Wisconsin Supreme Court ruled Thursday.

Donavinn Coffee pleaded guilty in June 2016 to armed robbery, attempted armed robbery and reckless endangerment in connection with a pair of robberies on the street one night in November 2015. Coffee shot and wounded a man during one of them.

According to court documents, prosecutors told Judge Frederick Rosa during Coffee’s sentencing hearing that Coffee had a lengthy criminal record, including a previous arrest for armed robbery in 2011. That was inaccurate — he was arrested for strong-arm robbery but not armed robbery — but no one caught the mistake at the time. Rosa mentioned the 2011 armed robbery arrest as part of his justification for sentencing Coffee to 13 years in prison.

Coffee later appealed, arguing that his due process rights were violated because the judge relied on inaccurate information.

The Supreme Court ruled 5-2 that defendants have a constitutional due process right to be sentenced based on accurate information and that Coffee’s rights were violated. However, the majority found that the mistake was harmless.

Prosecutors clearly introduced inaccurate information at Coffee’s sentencing hearing, Justice Annette Ziegler wrote for the majority. But the mention of the 2011 armed robbery arrest wasn’t integral to his sentence and the outcome likely would have been the same even if Rosa had all the right information in light of Coffee’s multiple run-ins with the law and increasingly violent behavior, she wrote.

Coffee’s attorney, listed in court documents as Nicole Masnica, didn’t immediately return a message Thursday morning.